New port for logstash5

Logstash is an open source, server-side data processing pipeline that ingests
data from a multitude of sources simultaneously, transforms it, and then sends
it to your favorite “stash.”

WWW: https://www.elastic.co/products/logstash
This commit is contained in:
Tom Judge 2016-11-04 07:38:09 +00:00
parent a959457ec0
commit 16631a2ca6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=425299
9 changed files with 10626 additions and 0 deletions

View file

@ -541,6 +541,7 @@
SUBDIR += logstalgia
SUBDIR += logstash
SUBDIR += logstash-forwarder
SUBDIR += logstash5
SUBDIR += logtool
SUBDIR += logwatch
SUBDIR += lookat

View file

@ -13,6 +13,8 @@ LICENSE= APACHE20
RUN_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash
CONFLICTS= logstash5-[0-9]*
USES= cpe
CPE_VENDOR= elasticsearch
USE_JAVA= yes

View file

@ -0,0 +1,56 @@
# Created by: Daniel Solsona <daniel@ish.com.au>, Guido Falsi <madpilot@FreeBSD.org>
# $FreeBSD$
PORTNAME= logstash
PORTVERSION= 5.0.0
CATEGORIES= sysutils java
MASTER_SITES= http://artifacts.elastic.co/downloads/logstash/
MAINTAINER= tj@FreeBSD.org
COMMENT= Server-side data ingest and transfomation tool
LICENSE= APACHE20
RUN_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash
CONFLICTS= logstash-[0-9]*
USES= cpe
CPE_VENDOR= elasticsearch
USE_JAVA= yes
JAVA_VERSION= 1.8+
JAVA_EXTRACT= yes
JAVA_RUN= yes
NO_BUILD= yes
LOGSTASH_DIR= ${PREFIX}/${PORTNAME}
USE_RC_SUBR= logstash
LOGSTASH_HOME?= ${PREFIX}/${PORTNAME}
LOGSTASH_RUN?= /var/run/${PORTNAME}
LOGSTASH_DATA_DIR?= /var/db/${PORTNAME}
SUB_LIST= LOGSTASH_DATA_DIR=${LOGSTASH_DATA_DIR} JAVA_HOME=${JAVA_HOME} \
LOGSTASH_HOME=${LOGSTASH_HOME}
LOGSTASH_BIN_FILES= logstash
LOGSTASH_JRUBY_SUBDIR= vendor/jruby/bin
LOGSTASH_JRUBY_BIN_FILES= ast irb jirb jruby jruby.sh rdoc testrb gem \
jgem jirb_swing jruby.bash jrubyc rake ri
do-install:
@${FIND} ${WRKSRC} -name '*.bat' -delete
${MKDIR} ${STAGEDIR}${ETCDIR}
${MKDIR} ${STAGEDIR}${LOGSTASH_RUN}
${MKDIR} ${STAGEDIR}${LOGSTASH_DATA_DIR}
@(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${LOGSTASH_DIR})
${INSTALL_DATA} ${FILESDIR}/logstash.conf.sample ${STAGEDIR}${ETCDIR}
.for x in ${LOGSTASH_BIN_FILES}
@${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/bin/${x}
.endfor
.for x in ${LOGSTASH_JRUBY_BIN_FILES}
@${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/${LOGSTASH_JRUBY_SUBDIR}/${x}
.endfor
.include <bsd.port.mk>

View file

@ -0,0 +1,3 @@
TIMESTAMP = 1478219215
SHA256 (logstash-5.0.0.tar.gz) = b5ff5336a49540510f415479deb64566c3b2dad1ce8856dde3df3b6ca1aa8d90
SIZE (logstash-5.0.0.tar.gz) = 104733142

View file

@ -0,0 +1,45 @@
input {
file {
type => "syslog"
# path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
path => "/var/log/messages"
start_position => "beginning"
}
}
filter {
# An filter may change the regular expression used to match a record or a field,
# alter the value of parsed fields, add or remove fields, etc.
#
# if [type] == "syslog" {
# grok {
# match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} (%{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}|%{GREEDYDATA:syslog_message})" }
# add_field => [ "received_at", "%{@timestamp}" ]
# add_field => [ "received_from", "%{@source_host}" ]
# }
#
# if !("_grokparsefailure" in [tags]) {
# mutate {
# replace => [ "@source_host", "%{syslog_hostname}" ]
# replace => [ "@message", "%{syslog_message}" ]
# }
# }
# mutate {
# remove_field => [ "syslog_hostname", "syslog_message" ]
# }
# date {
# match => [ "syslog_timestamp","MMM d HH:mm:ss", "MMM dd HH:mm:ss", "ISO8601" ]
# }
# syslog_pri { }
# }
}
output {
# Emit events to stdout for easy debugging of what is going through
# logstash.
# stdout { codec => rubydebug }
# This will use elasticsearch to store your logs.
# elasticsearch { hosts => [ "localhost:9200" ] }
}

View file

@ -0,0 +1,106 @@
#!/bin/sh
# Configuration settings for logstash in /etc/rc.conf:
#
# PROVIDE: logstash
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# logstash_enable (bool):
# Default value: "NO"
# Flag that determines whether Logstash is enabled.
#
# logstash_home (string):
# Default value: "/usr/local/logstash"
# Logstash installation directory.
#
# logstash_config (string):
# Default value: /usr/local/etc/${name}/${name}.conf
# Logstash configuration file path.
#
# logstash_log (bool):
# Set to "NO" by default.
# Set it to "YES" to enable logstash logging to file
# Default output to /var/log/logstash.log
#
# logstash_log_file (string):
# Default value: "${logdir}/${name}.log"
# Log file path.
#
# logstash_java_home (string):
# Default value: "/usr/local/openjdk8"
# Root directory of the desired Java SDK.
# The JAVA_HOME environment variable is set with the contents of this
# variable.
#
# logstash_java_opts (string):
# Default value: ""
# Options to pass to the Java Virtual Machine.
# The JAVA_OPTS environment variable is set with the contents of this
# variable.
#
# logstash_opts (string):
# Default value: ""
# Additional command line flags for logstash, eg. "-r"
#
. /etc/rc.subr
name=logstash
rcvar=logstash_enable
load_rc_config ${name}
logdir="/var/log"
: ${logstash_enable="NO"}
: ${logstash_home="%%LOGSTASH_HOME%%"}
: ${logstash_config="%%ETCDIR%%/${name}.conf"}
: ${logstash_log="YES"}
: ${logstash_log_dir="${logdir}/${name}"}
: ${logstash_java_home="%%JAVA_HOME%%"}
: ${logstash_java_opts=""}
: ${logstash_opts=""}
piddir=/var/run/${name}
pidfile=${piddir}/${name}.pid
if [ -d $piddir ]; then
mkdir -p $piddir
fi
start_precmd="logstash_precmd"
logstash_cmd="${logstash_home}/bin/logstash"
procname="${logstash_java_home}/bin/java"
logstash_chdir=${logstash_home}
logstash_log_options=""
if checkyesno logstash_log; then
logstash_log_options=" -l ${logstash_log_dir}"
fi
logstash_args="-f ${logstash_config} ${logstash_log_options} ${logstash_opts}"
JAVA_OPTS="${logstash_java_opts}"
JAVA_HOME="${logstash_java_home}"
export JAVA_OPTS
export JAVA_HOME
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} ${logstash_cmd} ${logstash_args}"
required_files="${logstash_home} ${logstash_java_home} ${logstash_cmd} ${logstash_config}"
# Include /usr/local/bin in path because Logstash startup scripts
# assume bash is in path.
PATH=/usr/local/bin:$PATH
logstash_precmd()
{
/usr/bin/install -d -o root -g wheel -m 750 ${logstash_log_dir}
}
run_rc_command "$1"

View file

@ -0,0 +1,5 @@
Logstash is an open source, server-side data processing pipeline that ingests
data from a multitude of sources simultaneously, transforms it, and then sends
it to your favorite “stash.”
WWW: https://www.elastic.co/products/logstash

View file

@ -0,0 +1,14 @@
To start logstash as an agent during startup, add
logstash_enable="YES"
to your /etc/rc.conf.
Extra options can be found in startup script.
NOTE: Since version 1.5.0, logstash is started in agent mode.
The Kibana web application is no longer embedded in this Logstash
distribution.
NOTE: Since version 2, logstash does not support an embedded
ElasticSearch instance.

10394
sysutils/logstash5/pkg-plist Normal file

File diff suppressed because it is too large Load diff