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
This commit is contained in:
parent
970ea2ad54
commit
6f5894dc42
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=367389
@ -463,6 +463,7 @@
|
||||
SUBDIR += logrotate
|
||||
SUBDIR += logstalgia
|
||||
SUBDIR += logstash
|
||||
SUBDIR += logstash-forwarder
|
||||
SUBDIR += logtool
|
||||
SUBDIR += logwatch
|
||||
SUBDIR += lookat
|
||||
|
30
sysutils/logstash-forwarder/Makefile
Normal file
30
sysutils/logstash-forwarder/Makefile
Normal file
@ -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>
|
2
sysutils/logstash-forwarder/distinfo
Normal file
2
sysutils/logstash-forwarder/distinfo
Normal file
@ -0,0 +1,2 @@
|
||||
SHA256 (logstash-forwarder-0.3.1.20140725.tar.gz) = 302b8bf9e073e8604d6d8485d71d8cff9e32e6e97869093036f406b695c2abae
|
||||
SIZE (logstash-forwarder-0.3.1.20140725.tar.gz) = 38998
|
31
sysutils/logstash-forwarder/files/logstash-forwarder.in
Normal file
31
sysutils/logstash-forwarder/files/logstash-forwarder.in
Normal file
@ -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"
|
14
sysutils/logstash-forwarder/files/patch-fileinfo_freebsd.go
Normal file
14
sysutils/logstash-forwarder/files/patch-fileinfo_freebsd.go
Normal file
@ -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
|
||||
+}
|
11
sysutils/logstash-forwarder/files/patch-filestate_freebsd.go
Normal file
11
sysutils/logstash-forwarder/files/patch-filestate_freebsd.go
Normal file
@ -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"`
|
||||
+}
|
31
sysutils/logstash-forwarder/files/pkg-message.in
Normal file
31
sysutils/logstash-forwarder/files/pkg-message.in
Normal file
@ -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!
|
||||
=========================================================================
|
9
sysutils/logstash-forwarder/pkg-descr
Normal file
9
sysutils/logstash-forwarder/pkg-descr
Normal file
@ -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
|
4
sysutils/logstash-forwarder/pkg-plist
Normal file
4
sysutils/logstash-forwarder/pkg-plist
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user