diff options
author | cs <cs@FreeBSD.org> | 2014-09-06 04:50:47 +0800 |
---|---|---|
committer | cs <cs@FreeBSD.org> | 2014-09-06 04:50:47 +0800 |
commit | 2d75893bb495672f87446cbf4627d2badf9cf89c (patch) | |
tree | d281b11df58de9a5d07cf91936f0896589958f1a /sysutils | |
parent | 16411efec4399c76626103a3664f2022648ff269 (diff) | |
download | freebsd-ports-gnome-2d75893bb495672f87446cbf4627d2badf9cf89c.tar.gz freebsd-ports-gnome-2d75893bb495672f87446cbf4627d2badf9cf89c.tar.zst freebsd-ports-gnome-2d75893bb495672f87446cbf4627d2badf9cf89c.zip |
I'm a lumberjack and I'm ok! I sleep when idle, then I ship logs all day!
I parse your logs, I eat the JVM agent for lunch!
(This project was recently renamed from 'lumberjack' to 'logstash-forwarder' to
make its intended use clear. The 'lumberjack' name now remains as the network
protocol, and 'logstash-forwarder' is the name of the program. It's still the
same lovely log forwarding program you love.)
WWW: https://github.com/elasticsearch/logstash-forwarder
PR: ports/193012
Submitted by: cheffo@freebsd-bg.org
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/Makefile | 1 | ||||
-rw-r--r-- | sysutils/logstash-forwarder/Makefile | 30 | ||||
-rw-r--r-- | sysutils/logstash-forwarder/distinfo | 2 | ||||
-rw-r--r-- | sysutils/logstash-forwarder/files/logstash-forwarder.in | 31 | ||||
-rw-r--r-- | sysutils/logstash-forwarder/files/patch-fileinfo_freebsd.go | 14 | ||||
-rw-r--r-- | sysutils/logstash-forwarder/files/patch-filestate_freebsd.go | 11 | ||||
-rw-r--r-- | sysutils/logstash-forwarder/files/pkg-message.in | 31 | ||||
-rw-r--r-- | sysutils/logstash-forwarder/pkg-descr | 9 | ||||
-rw-r--r-- | sysutils/logstash-forwarder/pkg-plist | 4 |
9 files changed, 133 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile index 13cc15836c8a..b6b3f596a20e 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -463,6 +463,7 @@ SUBDIR += logrotate SUBDIR += logstalgia SUBDIR += logstash + SUBDIR += logstash-forwarder SUBDIR += logtool SUBDIR += logwatch SUBDIR += lookat diff --git a/sysutils/logstash-forwarder/Makefile b/sysutils/logstash-forwarder/Makefile new file mode 100644 index 000000000000..7fbc6fa82794 --- /dev/null +++ b/sysutils/logstash-forwarder/Makefile @@ -0,0 +1,30 @@ +# $FreeBSD$ + +PORTNAME= logstash-forwarder +PORTVERSION= 0.3.1.20140725 +CATEGORIES= sysutils + +MAINTAINER= cheffo@freebsd-bg.org +COMMENT= Collect logs locally in preparation for processing elsewhere! + +LICENSE= APACHE20 + +BUILD_DEPENDS= go:${PORTSDIR}/lang/go + +USE_GITHUB= yes +GH_ACCOUNT= elasticsearch +GH_PROJECT= logstash-forwarder +GH_TAGNAME= ${GH_COMMIT} +GH_COMMIT= 8bb4001 + +USE_RC_SUBR= logstash-forwarder +SUB_FILES= pkg-message + +do-build: + cd ${WRKSRC} && ${PREFIX}/bin/go build + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} + ${INSTALL_DATA} ${WRKSRC}/logstash-forwarder.conf.example ${STAGEDIR}${PREFIX}/etc/logstash-forwarder.conf.example + +.include <bsd.port.mk> diff --git a/sysutils/logstash-forwarder/distinfo b/sysutils/logstash-forwarder/distinfo new file mode 100644 index 000000000000..3fff82642544 --- /dev/null +++ b/sysutils/logstash-forwarder/distinfo @@ -0,0 +1,2 @@ +SHA256 (logstash-forwarder-0.3.1.20140725.tar.gz) = 302b8bf9e073e8604d6d8485d71d8cff9e32e6e97869093036f406b695c2abae +SIZE (logstash-forwarder-0.3.1.20140725.tar.gz) = 38998 diff --git a/sysutils/logstash-forwarder/files/logstash-forwarder.in b/sysutils/logstash-forwarder/files/logstash-forwarder.in new file mode 100644 index 000000000000..35c43fd4aacc --- /dev/null +++ b/sysutils/logstash-forwarder/files/logstash-forwarder.in @@ -0,0 +1,31 @@ +#!/bin/sh +# $FreeBSD$ + +# PROVIDE: logstash_forwarder +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable logstash-forwarder: +# logstash_forwarder_enable (bool): Set to YES to logstash-forwarder +# Default: NO +# logstash_forwarder_flags (str): Extra flags passed to logstash-forwarder +# logstash_forwarder_conf (str): logstash-forwarder configuration file +# Default: ${PREFIX}/etc/logstash-forwarder.conf + + +. /etc/rc.subr + +name="logstash_forwarder" +rcvar=logstash_forwarder_enable + +command="%%PREFIX%%/bin/logstash-forwarder" + +load_rc_config $name + +[ -z "$logstash_forwarder_enable" ] && logstash_forwarder_enable="NO" +[ -z "$logstash_forwarder_conf" ] && logstash_forwarder_conf="%%PREFIX%%/etc/logstash-forwarder.conf" +[ -z "$logstash_forwarder_flags" ] && logstash_forwarder_flags="" +[ -n "$logstash_forwarder_conf" ] && logstash_forwarder_flags="$logstash_forwarder_flags -config=$logstash_forwarder_conf" + +run_rc_command "$1" diff --git a/sysutils/logstash-forwarder/files/patch-fileinfo_freebsd.go b/sysutils/logstash-forwarder/files/patch-fileinfo_freebsd.go new file mode 100644 index 000000000000..498719c4eb42 --- /dev/null +++ b/sysutils/logstash-forwarder/files/patch-fileinfo_freebsd.go @@ -0,0 +1,14 @@ +--- fileinfo_freebsd.go.orig 1970-01-01 02:00:00.000000000 +0200 ++++ fileinfo_freebsd.go 2014-08-15 15:55:47.824555519 +0300 +@@ -0,0 +1,11 @@ ++package main ++ ++import ( ++ "os" ++ "syscall" ++) ++ ++func file_ids(info *os.FileInfo) (uint32, uint32) { ++ fstat := (*(info)).Sys().(*syscall.Stat_t) ++ return fstat.Ino, fstat.Dev ++} diff --git a/sysutils/logstash-forwarder/files/patch-filestate_freebsd.go b/sysutils/logstash-forwarder/files/patch-filestate_freebsd.go new file mode 100644 index 000000000000..e35ed3b41d21 --- /dev/null +++ b/sysutils/logstash-forwarder/files/patch-filestate_freebsd.go @@ -0,0 +1,11 @@ +--- filestate_freebsd.go.orig 1970-01-01 02:00:00.000000000 +0200 ++++ filestate_freebsd.go 2014-08-15 15:56:07.164481962 +0300 +@@ -0,0 +1,8 @@ ++package main ++ ++type FileState struct { ++ Source *string `json:"source,omitempty"` ++ Offset int64 `json:"offset,omitempty"` ++ Inode uint32 `json:"inode,omitempty"` ++ Device uint32 `json:"device,omitempty"` ++} diff --git a/sysutils/logstash-forwarder/files/pkg-message.in b/sysutils/logstash-forwarder/files/pkg-message.in new file mode 100644 index 000000000000..30355147c119 --- /dev/null +++ b/sysutils/logstash-forwarder/files/pkg-message.in @@ -0,0 +1,31 @@ +========================================================================= +If you want to run logstash-forwarder, add to /etc/rc.conf + + logstash_forwarder_enable="YES" + +Do not forget to edit your configuration file: + + Default: ${PREFIX}/etc/logstash-forwarder.conf + +Key points + +You'll need an SSL CA to verify the server (host) with. +You can specify custom fields for each set of paths in the config file. +Any number of these may be specified. I use them to set fields like type +and other custom attributes relevant to each log. + +Generating an ssl certificate + +Logstash supports all certificates, including self-signed certificates. +To generate a certificate, you can run the following command: + + $ openssl req -x509 -batch -nodes -newkey rsa:2048 -keyout \ + logstash-forwarder.key -out logstash-forwarder.crt -days 365 + +This will generate a key at logstash-forwarder.key and the 1-year valid +certificate at logstash-forwarder.crt. Both the server that is running +logstash-forwarder as well as the logstash instances receiving logs will +require these files on disk to verify the authenticity of messages. + +PROTECT YOUR KEYS! +========================================================================= diff --git a/sysutils/logstash-forwarder/pkg-descr b/sysutils/logstash-forwarder/pkg-descr new file mode 100644 index 000000000000..96863b900fd4 --- /dev/null +++ b/sysutils/logstash-forwarder/pkg-descr @@ -0,0 +1,9 @@ +I'm a lumberjack and I'm ok! I sleep when idle, then I ship logs all day! +I parse your logs, I eat the JVM agent for lunch! + +(This project was recently renamed from 'lumberjack' to 'logstash-forwarder' to +make its intended use clear. The 'lumberjack' name now remains as the network +protocol, and 'logstash-forwarder' is the name of the program. It's still the +same lovely log forwarding program you love.) + +WWW: https://github.com/elasticsearch/logstash-forwarder diff --git a/sysutils/logstash-forwarder/pkg-plist b/sysutils/logstash-forwarder/pkg-plist new file mode 100644 index 000000000000..e5cf0f38196e --- /dev/null +++ b/sysutils/logstash-forwarder/pkg-plist @@ -0,0 +1,4 @@ +bin/logstash-forwarder +@unexec if cmp -s %D/etc/logstash-forwarder.conf.example %D/etc/logstash-forwarder.conf; then rm -f %D/etc/logstash-forwarder.conf; fi +etc/logstash-forwarder.conf.example +@exec if [ ! -f %D/etc/logstash-forwarder.conf ] ; then cp -p %D/%F %B/logstash-forwarder.conf; fi |