diff options
Diffstat (limited to 'app-admin/logstash-bin/files')
-rw-r--r-- | app-admin/logstash-bin/files/agent.conf.sample-r2 | 20 | ||||
-rw-r--r-- | app-admin/logstash-bin/files/logstash.confd | 2 | ||||
-rw-r--r-- | app-admin/logstash-bin/files/logstash.confd-r2 | 9 | ||||
-rw-r--r-- | app-admin/logstash-bin/files/logstash.initd | 33 | ||||
-rw-r--r-- | app-admin/logstash-bin/files/logstash.initd-r2 | 49 |
5 files changed, 78 insertions, 35 deletions
diff --git a/app-admin/logstash-bin/files/agent.conf.sample-r2 b/app-admin/logstash-bin/files/agent.conf.sample-r2 new file mode 100644 index 000000000000..96781bd3327b --- /dev/null +++ b/app-admin/logstash-bin/files/agent.conf.sample-r2 @@ -0,0 +1,20 @@ +input { + stdin { + type => "stdin" + } + + file { + type => "syslog" + path => [ "/var/log/*.log", "/var/log/debug", "/var/log/messages", "/var/log/syslog" ] + } +} + +output { + stdout { + codec => rubydebug + } + + elasticsearch { + hosts => localhost + } +} diff --git a/app-admin/logstash-bin/files/logstash.confd b/app-admin/logstash-bin/files/logstash.confd deleted file mode 100644 index 29f4d1c016ae..000000000000 --- a/app-admin/logstash-bin/files/logstash.confd +++ /dev/null @@ -1,2 +0,0 @@ -#LOGSTASH_USER="" -#LOGSTASH_GROUP="" diff --git a/app-admin/logstash-bin/files/logstash.confd-r2 b/app-admin/logstash-bin/files/logstash.confd-r2 new file mode 100644 index 000000000000..cb6839569537 --- /dev/null +++ b/app-admin/logstash-bin/files/logstash.confd-r2 @@ -0,0 +1,9 @@ +#LS_USER="root" +#LS_GROUP="root" +#LS_CONFDIR="/etc/logstash/conf.d" +#LS_LOGFILE="/var/log/logstash/logstash.log" +#LS_PIDFILE="/run/logstash/logstash.pid" +#LS_HEAP_SIZE="500m" +#LS_NICE=19 +#LS_OPEN_FILES=16384 +#LS_OPTS="" diff --git a/app-admin/logstash-bin/files/logstash.initd b/app-admin/logstash-bin/files/logstash.initd deleted file mode 100644 index 08b063fe7044..000000000000 --- a/app-admin/logstash-bin/files/logstash.initd +++ /dev/null @@ -1,33 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -LOGSTASH_USER=${LOGSTASH_USER:-root} -LOGSTASH_GROUP=${LOGSTASH_GROUP:-root} -LOGFILE="/var/log/logstash/logstash.log" - -command="/opt/logstash/bin/logstash" -command_args="agent --config /etc/logstash/conf.d/*.conf --log ${LOGFILE}" -extra_commands="checkconfig" -command_background="true" -start_stop_daemon_args="--user=\"${LOGSTASH_USER}\"" -pidfile="/run/logstash/logstash.pid" - -depend() { - use net - after elasticsearch -} - -checkconfig() { - ebegin "Checking your configuration" - ${command} ${command_args} --configtest - eend $? "Configuration error. Please fix your configuration files." -} - -start_pre() { - checkconfig || return 1 - - checkpath -d -o "${LOGSTASH_USER}":"${LOGSTASH_GROUP}" -m750 "$(dirname "${pidfile}")" - checkpath -d -o "${LOGSTASH_USER}":"${LOGSTASH_GROUP}" -m750 "$(dirname "${LOGFILE}")" - checkpath -f -o "${LOGSTASH_USER}":"${LOGSTASH_GROUP}" -m640 "${LOGFILE}" -} diff --git a/app-admin/logstash-bin/files/logstash.initd-r2 b/app-admin/logstash-bin/files/logstash.initd-r2 new file mode 100644 index 000000000000..e4abf59b0fa0 --- /dev/null +++ b/app-admin/logstash-bin/files/logstash.initd-r2 @@ -0,0 +1,49 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +LS_USER="${LS_USER:-root}" +LS_GROUP="${LS_GROUP:-root}" +LS_CONFDIR="${LS_CONFDIR:-/etc/logstash/conf.d}" +LS_LOGFILE="${LS_LOGFILE:-/var/log/logstash/logstash.log}" +LS_PIDFILE="${LS_PIDFILE:-/run/logstash/logstash.pid}" +LS_NICE="${LS_NICE:-19}" +LS_OPEN_FILES="${LS_OPEN_FILES:-16384}" +LS_HEAP_SIZE="${LS_HEAP_SIZE:-500m}" + +command="/opt/logstash/bin/logstash" +command_args="agent --config ${LS_CONFDIR}/*.conf --log ${LS_LOGFILE} ${LS_OPTS}" +extra_commands="checkconfig" +command_background="true" +start_stop_daemon_args="--nicelevel ${LS_NICE} \ + --user ${LS_USER}:${LS_GROUP} \ + --env LS_HEAP_SIZE=${LS_HEAP_SIZE}" +pidfile="${LS_PIDFILE}" + +depend() { + use net + after elasticsearch +} + +checkconfig() { + ebegin "Checking your configuration" + ${command} ${command_args} --configtest + eend $? "Configuration error. Please fix your configuration files." +} + +start_pre() { + checkconfig || return 1 + + checkpath -d -o "${LS_USER}":"${LS_GROUP}" -m750 "$(dirname "${LS_PIDFILE}")" + checkpath -d -o "${LS_USER}":"${LS_GROUP}" -m750 "$(dirname "${LS_LOGFILE}")" + checkpath -f -o "${LS_USER}":"${LS_GROUP}" -m640 "${LS_LOGFILE}" + + rc_ulimit="-n ${LS_OPEN_FILES}" +} + +stop() { + ebegin "Stopping logstash" + start-stop-daemon --stop \ + --pidfile="${LS_PIDFILE}" \ + --retry=TERM/5/KILL/5 +} |