...
 
Commits (8)
VERSION=0.3.1+uninett2
VERSION=0.3.1+uninett5
# By default, all dependencies (zeromq, etc) will be downloaded and installed
# locally. You can change this if you are deploying your own.
......@@ -6,7 +6,7 @@ VERSION=0.3.1+uninett2
VENDOR=
# Where to install to.
PREFIX?=/opt/logstash-forwarder
PREFIX?=/usr/local/logstash-forwarder
FETCH=sh fetch.sh
MAKE?=make
......@@ -44,22 +44,25 @@ vendor-clean:
$(MAKE) -C vendor/zeromq/ clean
$(MAKE) -C vendor/zlib/ clean
rpm deb: PREFIX=/opt/logstash-forwarder
rpm: OS=lsb
deb: OS=debian
rpm deb: PREFIX=/usr/local/logstash-forwarder
rpm deb: | build-all
fpm -s dir -t $@ -n logstash-forwarder -v $(VERSION) \
--replaces logstash-forwarder \
--after-install logstash-forwarder.postinst \
--after-remove logstash-forwarder.remove \
--after-install logstash-forwarder.$(OS).postinst \
--after-remove logstash-forwarder.$(OS).remove \
--exclude '*.a' --exclude 'lib/pkgconfig/zlib.pc' \
--description "a log shipping tool" \
--url "https://github.com/elasticsearch/logstash-forwarder" \
build/bin/logstash-forwarder=$(PREFIX)/bin/ \
build/bin/logstash-forwarder.sh=$(PREFIX)/bin/ \
logrouter_uninett.pem=/etc/ssl/certs/ \
uninett-ca.pem=/etc/ssl/certs/ \
logstash-forwarder.conf=/etc/logstashforwarder/config.json.example \
logstash-forwarder.default=/etc/default/logstash-forwarder \
logstash-forwarder.logrotate=/etc/logrotate.d/logstash-forwarder \
logstash-forwarder.init=/etc/init.d/logstash-forwarder
logstash-forwarder.$(OS).init=/etc/init.d/logstash-forwarder
# Vendor'd dependencies
# If VENDOR contains 'zeromq' download and build it.
......
......@@ -134,7 +134,7 @@ Or:
If you don't use rpm or deb make targets as above, you can skip this section.
Packages install to `/opt/logstash-forwarder`.
Packages install to `/usr/local/logstash-forwarder`.
There are no run-time dependencies.
......
-----BEGIN CERTIFICATE-----
MIIFXTCCA0WgAwIBAgIJAI6KBv1kEwH/MA0GCSqGSIb3DQ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cuVWMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggIB
AMDIwFd+uRzEbXy8xXDufYgs466u5mq1ZsdpUtH/hYo8lVSOTlJS1Dd6LAX+Ir+B
ePtubH4J1ijH9DjnKrpftUCz9cWOOguYmmeYDq3rSEi1m2x3HNgt6OhnlkEVDbLM
noWMWZ86Gxnns43gpvOybAYdosjwgBJMFJd5oNx4Q7GEZTj09H+13v+Yw3BVoeiV
6C5kO6wT9UOK18xQcWZ573UbPzzM8HjfyoNBR4x+gnPAWt9c5Dq4vZLrSS58jIyh
C1Pa5OAdt0B/6EOZ+eUjQ8dHvwFyIRzI+Jn0/4tt2QSsDB0xLnLvRATnY0zLoygg
iX2bXleeyAVeqpOSljHZupOYwiq7zeWYLaoWHSzDUOjmClyBMbBFgh3odzWlq8il
rThvfx27m1Mu9hXEtixhfajr5XS5HehPO4BE0wBxYBofl//m3hSLShu6csAPmiYF
VETNtULLv4HEZz0LQwf2tbhkfBGd3FlUf9M23K+Md3+ADMsSkiyNCjUhY0STJpkY
tvPqYyFiuVDEo7x4hZgcjBpNXtAv/7UXBVL/N2CrdnWGWNmZtt86mJX54xqfcRGL
4HU5c/dxLjzaS0wh7vb0L4gZxKJ0yNqGdVO5FQTiF/Dx5I6k1ZuKbpKS5lk+YQaU
C4jImUvN5+QBVWV0t2B0yMk/AAnsm777qxdT4qhydXNt
-----END CERTIFICATE-----
......@@ -4,8 +4,8 @@
"comment": "forwarder will choose one at random and will switch to next",
"servers": [ "localhost:5000","localhost1:5000" ],
"ssl ca": "/etc/ssl/certs/logrouter_uninett.pem",
"timeout": 10
"ssl ca": "/etc/ssl/certs/uninett-ca.pem",
"timeout": 20
},
"comment": "Here you specify the log file you want to monitor",
"comment": "and ship them to log cluster to process",
......
......@@ -16,7 +16,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="log shipper"
NAME=logstash-forwarder
DAEMON=/opt/logstash-forwarder/bin/logstash-forwarder
DAEMON=/usr/local/logstash-forwarder/bin/logstash-forwarder
DAEMON_ARGS="-config /etc/logstashforwarder/config.json -spool-size 100 -log-to-syslog"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
......
......@@ -5,5 +5,8 @@
missingok
delaycompress
compress
postrotate
/etc/init.d/logstash-forwarder restart >/dev/null
endscript
}
#! /bin/sh
### BEGIN INIT INFO
# Provides: logstash-forwarder
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: UNINETT LAaaS Log Shipper LSB
# Description: Ship logfiles to the UNINETT LAaaS service
### END INIT INFO
# Author: Jordan Sissel <jordan.sissel@dreamhost.com>
# Author: Jørn Åne de Jong <jorn.dejong@uninett.no>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="log shipper"
NAME=logstash-forwarder
DAEMON=/usr/local/logstash-forwarder/bin/logstash-forwarder
DAEMON_ARGS="-config /etc/logstashforwarder/config.json -spool-size 100 -log-to-syslog"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
LOGFILE=/var/log/$NAME.log
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
if [[ -f /lib/lsb/init-functions ]]; then
. /lib/lsb/init-functions
elif [[ -f /etc/init.d/functions ]]; then
. /etc/init.d/functions
else
echo "Linux LSB init function script or Redhat /etc/init.d/functions is required for this script."
echo "See http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html"
exit 1
fi
COMMAND="cd /var/run; exec $DAEMON $DAEMON_ARGS"
do_start() {
if [ -z "$DAEMON" ]; then
echo "not found - $DAEMON"
exit 1
fi
if pidofproc -p "$PIDFILE" "$DAEMON" >/dev/null; then
exit 0
fi
exec $DAEMON $DAEMON_ARGS >> $LOGFILE 2>&1 < /dev/null &
RETVAL=$?
local PID=$!
usleep 500000
echo $PID > $PIDFILE
}
do_stop()
{
killproc -p $PIDFILE $DAEMON
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${PIDFILE}
}
case "$1" in
start)
echo "Starting $DESC" "$NAME"
do_start
;;
stop)
echo "Stopping $DESC" "$NAME"
do_stop
;;
status)
echo -n "Status of $DESC"
status -p $PIDFILE
exit $?
;;
restart|force-reload)
echo "Restarting $DESC" "$NAME"
do_stop
do_start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:
#! /bin/sh
chkconfig --add logstash-forwarder
service logstash-forwarder restart
#! /bin/sh
service logstash-forwarder stop
chkconfig --del logstash-forwarder
......@@ -7,7 +7,6 @@ import (
"crypto/x509"
"encoding/binary"
"encoding/pem"
"fmt"
"io"
"io/ioutil"
"log"
......@@ -20,7 +19,7 @@ import (
)
var hostname string
var hostport_re, _ = regexp.Compile("^(.+):([0-9]+)$")
var hostport_re, _ = regexp.Compile(`^\[?([^]]+)\]?:([0-9]+)$`)
func init() {
log.Printf("publisher init\n")
......@@ -180,7 +179,7 @@ func connect(config *NetworkConfig) (socket *tls.Conn) {
}
address := addresses[rand.Int()%len(addresses)]
addressport := fmt.Sprintf("%s:%s", address, port)
addressport := net.JoinHostPort(address, port)
log.Printf("Connecting to %s (%s) \n", addressport, host)
......
-----BEGIN CERTIFICATE-----
MIIEbzCCA1egAwIBAgIJAJAhu7l6dg+nMA0GCSqGSIb3DQEBBQUAMEoxCzAJBgNV
BAYTAk5PMRMwEQYDVQQKEwpVTklORVRUIEFTMSYwJAYDVQQDEx1VTklORVRUIENl
cnRpZmljYXRlIEF1dGhvcml0eTAeFw0xMDAyMDYwMDEyMzBaFw0yMDAyMDQwMDEy
MzBaMEoxCzAJBgNVBAYTAk5PMRMwEQYDVQQKEwpVTklORVRUIEFTMSYwJAYDVQQD
Ex1VTklORVRUIENlcnRpZmljYXRlIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEB
BQADggEPADCC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