Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2014 20:50:47 +0000 (UTC)
From:      Carlo Strub <cs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r367389 - in head/sysutils: . logstash-forwarder logstash-forwarder/files
Message-ID:  <201409052050.s85Kolca030045@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cs
Date: Fri Sep  5 20:50:47 2014
New Revision: 367389
URL: http://svnweb.freebsd.org/changeset/ports/367389
QAT: https://qat.redports.org/buildarchive/r367389/

Log:
  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

Added:
  head/sysutils/logstash-forwarder/
  head/sysutils/logstash-forwarder/Makefile   (contents, props changed)
  head/sysutils/logstash-forwarder/distinfo   (contents, props changed)
  head/sysutils/logstash-forwarder/files/
  head/sysutils/logstash-forwarder/files/logstash-forwarder.in   (contents, props changed)
  head/sysutils/logstash-forwarder/files/patch-fileinfo_freebsd.go   (contents, props changed)
  head/sysutils/logstash-forwarder/files/patch-filestate_freebsd.go   (contents, props changed)
  head/sysutils/logstash-forwarder/files/pkg-message.in   (contents, props changed)
  head/sysutils/logstash-forwarder/pkg-descr   (contents, props changed)
  head/sysutils/logstash-forwarder/pkg-plist   (contents, props changed)
Modified:
  head/sysutils/Makefile

Modified: head/sysutils/Makefile
==============================================================================
--- head/sysutils/Makefile	Fri Sep  5 20:44:35 2014	(r367388)
+++ head/sysutils/Makefile	Fri Sep  5 20:50:47 2014	(r367389)
@@ -463,6 +463,7 @@
     SUBDIR += logrotate
     SUBDIR += logstalgia
     SUBDIR += logstash
+    SUBDIR += logstash-forwarder
     SUBDIR += logtool
     SUBDIR += logwatch
     SUBDIR += lookat

Added: head/sysutils/logstash-forwarder/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/logstash-forwarder/Makefile	Fri Sep  5 20:50:47 2014	(r367389)
@@ -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>

Added: head/sysutils/logstash-forwarder/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/logstash-forwarder/distinfo	Fri Sep  5 20:50:47 2014	(r367389)
@@ -0,0 +1,2 @@
+SHA256 (logstash-forwarder-0.3.1.20140725.tar.gz) = 302b8bf9e073e8604d6d8485d71d8cff9e32e6e97869093036f406b695c2abae
+SIZE (logstash-forwarder-0.3.1.20140725.tar.gz) = 38998

Added: head/sysutils/logstash-forwarder/files/logstash-forwarder.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/logstash-forwarder/files/logstash-forwarder.in	Fri Sep  5 20:50:47 2014	(r367389)
@@ -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"

Added: head/sysutils/logstash-forwarder/files/patch-fileinfo_freebsd.go
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/logstash-forwarder/files/patch-fileinfo_freebsd.go	Fri Sep  5 20:50:47 2014	(r367389)
@@ -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
++}

Added: head/sysutils/logstash-forwarder/files/patch-filestate_freebsd.go
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/logstash-forwarder/files/patch-filestate_freebsd.go	Fri Sep  5 20:50:47 2014	(r367389)
@@ -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"`
++}

Added: head/sysutils/logstash-forwarder/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/logstash-forwarder/files/pkg-message.in	Fri Sep  5 20:50:47 2014	(r367389)
@@ -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!
+=========================================================================

Added: head/sysutils/logstash-forwarder/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/logstash-forwarder/pkg-descr	Fri Sep  5 20:50:47 2014	(r367389)
@@ -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

Added: head/sysutils/logstash-forwarder/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/logstash-forwarder/pkg-plist	Fri Sep  5 20:50:47 2014	(r367389)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409052050.s85Kolca030045>