diff options
author | madpilot <madpilot@FreeBSD.org> | 2013-11-21 20:35:12 +0800 |
---|---|---|
committer | madpilot <madpilot@FreeBSD.org> | 2013-11-21 20:35:12 +0800 |
commit | 157618a7cf816ea2f718fa7882195b8fa9fb1688 (patch) | |
tree | c886805203d1e48cb0baa936f15a17e8b02db7de /sysutils | |
parent | 722ba88907d03f17955dabf46cba6208c69dc79c (diff) | |
download | freebsd-ports-gnome-157618a7cf816ea2f718fa7882195b8fa9fb1688.tar.gz freebsd-ports-gnome-157618a7cf816ea2f718fa7882195b8fa9fb1688.tar.zst freebsd-ports-gnome-157618a7cf816ea2f718fa7882195b8fa9fb1688.zip |
- Upgrade to 1.2.1
- Make sample config file work with BSD syslog
- Startup script fixes
- Convert to staging
PR: ports/182492
Submitted by: Regis A. Despres <regis.despres@gmail.com> (maintainer)
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/logstash/Makefile | 25 | ||||
-rw-r--r-- | sysutils/logstash/distinfo | 4 | ||||
-rw-r--r-- | sysutils/logstash/files/logstash.conf.sample | 47 | ||||
-rw-r--r-- | sysutils/logstash/files/logstash.in | 7 | ||||
-rw-r--r-- | sysutils/logstash/pkg-plist | 4 |
5 files changed, 48 insertions, 39 deletions
diff --git a/sysutils/logstash/Makefile b/sysutils/logstash/Makefile index 53d35ecb707d..abfa7d49bc04 100644 --- a/sysutils/logstash/Makefile +++ b/sysutils/logstash/Makefile @@ -2,10 +2,10 @@ # $FreeBSD$ PORTNAME= logstash -PORTVERSION= 1.1.13 +PORTVERSION= 1.2.1 CATEGORIES= sysutils java MASTER_SITES= https://logstash.objects.dreamhost.com/release/ \ - http://semicomplete.com/files/logstash/ + https://download.elasticsearch.org/logstash/logstash/ DISTNAME= ${PORTNAME}-${PORTVERSION}-flatjar EXTRACT_SUFX= .jar EXTRACT_ONLY= @@ -32,20 +32,13 @@ PLIST_SUB+= LOGSTASH_HOME=${LOGSTASH_HOME_REL} LOGSTASH_JAR=${LOGSTASH_JAR} \ LOGSTASH_RUN=${LOGSTASH_RUN} \ LOGSTASH_DATA_DIR=${LOGSTASH_DATA_DIR} -NO_STAGE= yes do-install: - ${MKDIR} ${LOGSTASH_RUN} - ${MKDIR} ${ETCDIR} - ${MKDIR} ${LOGSTASH_HOME} - ${MKDIR} ${LOGSTASH_DATA_DIR} - ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${LOGSTASH_JAR} ${LOGSTASH_HOME} - ${INSTALL_DATA} ${FILESDIR}/logstash.conf.sample ${ETCDIR} - @if [ ! -f ${ETCDIR}/logstash.conf ]; then \ - ${CP} -p ${ETCDIR}/logstash.conf.sample ${ETCDIR}/logstash.conf ; \ - fi - ${INSTALL_DATA} ${FILESDIR}/elasticsearch.yml.sample ${ETCDIR} - @if [ ! -f ${ETCDIR}/elasticsearch.yml ]; then \ - ${CP} -p ${ETCDIR}/elasticsearch.yml.sample ${ETCDIR}/elasticsearch.yml ; \ - fi + ${MKDIR} ${STAGEDIR}${ETCDIR} + ${MKDIR} ${STAGEDIR}${LOGSTASH_HOME} + ${MKDIR} ${STAGEDIR}${LOGSTASH_RUN} + ${MKDIR} ${STAGEDIR}${LOGSTASH_DATA_DIR} + ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${LOGSTASH_JAR} ${STAGEDIR}${LOGSTASH_HOME} + ${INSTALL_DATA} ${FILESDIR}/logstash.conf.sample ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${FILESDIR}/elasticsearch.yml.sample ${STAGEDIR}${ETCDIR} .include <bsd.port.mk> diff --git a/sysutils/logstash/distinfo b/sysutils/logstash/distinfo index f3fdd78ce0d7..4b43392f4e73 100644 --- a/sysutils/logstash/distinfo +++ b/sysutils/logstash/distinfo @@ -1,2 +1,2 @@ -SHA256 (logstash-1.1.13-flatjar.jar) = 5ba0639ff4da064c2a4f6a04bd7006b1997a6573859d3691e210b6855e1e47f1 -SIZE (logstash-1.1.13-flatjar.jar) = 69485313 +SHA256 (logstash-1.2.1-flatjar.jar) = d0b8a56fb1aa71d54c2bab71709d900b359fdf8c6d7d6ff15578423a0d86ee23 +SIZE (logstash-1.2.1-flatjar.jar) = 81648562 diff --git a/sysutils/logstash/files/logstash.conf.sample b/sysutils/logstash/files/logstash.conf.sample index cd6ab9a6fcad..1aa37277aade 100644 --- a/sysutils/logstash/files/logstash.conf.sample +++ b/sysutils/logstash/files/logstash.conf.sample @@ -1,27 +1,42 @@ input { - file { - type => "system logs" - # # Wildcards work, here :) - # path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ] - path => [ "/var/log/messages" ] - } - - #file { - # type => "Hudson-access" - # path => "/var/log/www/hudson.ish.com.au-access_log" - #} + file { + type => "syslog" + # # Wildcards work, here :) + # path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ] + path => "/var/log/messages" + start_position => "beginning" + } +} - #file { - # type => "Syslog" - # path => "/var/log/messages" - #} +filter { + 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 { } + #stdout { debug => "true" } # This will use elasticsearch to store your logs. # The 'embedded' option will cause logstash to run the elasticsearch diff --git a/sysutils/logstash/files/logstash.in b/sysutils/logstash/files/logstash.in index 7e269f538b5c..07a5766a3f8f 100644 --- a/sysutils/logstash/files/logstash.in +++ b/sysutils/logstash/files/logstash.in @@ -33,6 +33,8 @@ rcvar=logstash_enable load_rc_config ${name} +logdir="/var/log" + : ${logstash_enable="NO"} : ${logstash_home="%%LOGSTASH_HOME%%"} : ${logstash_config="%%PREFIX%%/etc/${name}/${name}.conf"} @@ -52,7 +54,6 @@ if [ -d $piddir ]; then mkdir -p $piddir fi -logdir="/var/log" command="/usr/sbin/daemon" java_cmd="${logstash_java_home}/bin/java" @@ -67,12 +68,12 @@ if checkyesno logstash_log; then fi if [ ${logstash_mode} = "standalone" ]; then - logstash_args="agent -f ${logstash_config} -- web --port ${logstash_port} --backend elasticsearch:///?local ${logstash_log_options}" + logstash_args="agent -f ${logstash_config} ${logstash_log_options} -- web --port ${logstash_port}" logstash_elastic_options="-Des.path.data=${logstash_elastic_datadir}" elif [ ${logstash_mode} = "agent" ]; then logstash_args="agent -f ${logstash_config} ${logstash_log_options}" elif [ ${logstash_mode} = "web" ]; then - logstash_args="web --port ${logstash_port} --backend elasticsearch://${logstash_elastic_backend}/ ${logstash_log_options}" + logstash_args="web --port ${logstash_port} ${logstash_log_options}" fi command_args="-f -p ${pidfile} ${java_cmd} ${logstash_elastic_options} -jar ${logstash_jar} ${logstash_args}" diff --git a/sysutils/logstash/pkg-plist b/sysutils/logstash/pkg-plist index 04d23a140975..1593c19655af 100644 --- a/sysutils/logstash/pkg-plist +++ b/sysutils/logstash/pkg-plist @@ -7,7 +7,7 @@ @unexec if cmp -s %D/%%ETCDIR%%/elasticsearch.yml.sample %D/%%ETCDIR%%/elasticsearch.yml; then rm -f %D/%%ETCDIR%%/elasticsearch.yml; fi %%ETCDIR%%/elasticsearch.yml.sample @exec if [ ! -f %D/%%ETCDIR%%/elasticsearch.yml ] ; then cp -p %D/%F %B/elasticsearch.yml; fi -@dirrmtry %%LOGSTASH_DATA_DIR%% @dirrmtry %%LOGSTASH_HOME%% @dirrmtry %%ETCDIR%% -@dirrmtry %%LOGSTASH_RUN%% +@unexec rmdir %%LOGSTASH_DATA_DIR%% 2>/dev/null || true +@unexec rmdir %%LOGSTASH_RUN%% 2>/dev/null || true |