diff options
author | girgen <girgen@FreeBSD.org> | 2016-05-28 02:16:40 +0800 |
---|---|---|
committer | girgen <girgen@FreeBSD.org> | 2016-05-28 02:16:40 +0800 |
commit | 93f6631f0504108d67fad928bce94ad117f4672d (patch) | |
tree | 03cd1a02a757a39bb73c01cf4e1e2b856de01766 | |
parent | ab3235370f46818a35528016f74cd14f03fdf707 (diff) | |
download | freebsd-ports-gnome-93f6631f0504108d67fad928bce94ad117f4672d.tar.gz freebsd-ports-gnome-93f6631f0504108d67fad928bce94ad117f4672d.tar.zst freebsd-ports-gnome-93f6631f0504108d67fad928bce94ad117f4672d.zip |
Add filebeat and packagebeat from Elastic
Thanks to Kurt Jaeger and Riccardo Calixte for
collaboration and testing.
PR: 209776
-rw-r--r-- | sysutils/Makefile | 2 | ||||
-rw-r--r-- | sysutils/filebeat/Makefile | 33 | ||||
-rw-r--r-- | sysutils/filebeat/distinfo | 3 | ||||
-rw-r--r-- | sysutils/filebeat/files/filebeat.in | 36 | ||||
-rw-r--r-- | sysutils/filebeat/files/patch-libbeat_scripts_Makefile | 11 | ||||
-rw-r--r-- | sysutils/filebeat/pkg-descr | 13 | ||||
-rw-r--r-- | sysutils/filebeat/pkg-plist | 2 | ||||
-rw-r--r-- | sysutils/packetbeat/Makefile | 35 | ||||
-rw-r--r-- | sysutils/packetbeat/distinfo | 3 | ||||
-rw-r--r-- | sysutils/packetbeat/files/packetbeat.in | 37 | ||||
-rw-r--r-- | sysutils/packetbeat/files/patch-libbeat_scripts_Makefile | 11 | ||||
-rw-r--r-- | sysutils/packetbeat/pkg-descr | 12 | ||||
-rw-r--r-- | sysutils/packetbeat/pkg-plist | 2 |
13 files changed, 200 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile index 99e163b5f1f0..c2d6d026ab3b 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -274,6 +274,7 @@ SUBDIR += fetchlog SUBDIR += ffs2recov SUBDIR += file + SUBDIR += filebeat SUBDIR += filedupe SUBDIR += filelight-kde4 SUBDIR += fileprune @@ -712,6 +713,7 @@ SUBDIR += p5-arclog SUBDIR += p5-reslog SUBDIR += packer + SUBDIR += packetbeat SUBDIR += pacman SUBDIR += paicc SUBDIR += pam_mount diff --git a/sysutils/filebeat/Makefile b/sysutils/filebeat/Makefile new file mode 100644 index 000000000000..68081f08b3b6 --- /dev/null +++ b/sysutils/filebeat/Makefile @@ -0,0 +1,33 @@ +# Created by: Palle Girgensohn <girgen@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= filebeat +PORTVERSION= 1.2.3 +DISTVERSIONPREFIX=v +CATEGORIES= sysutils + +MAINTAINER= girgen@FreeBSD.org +COMMENT= Collect logs locally and send to remote logstash + +LICENSE= APACHE20 + +USE_GITHUB= yes +GH_ACCOUNT= elastic +GH_PROJECT= beats + +USES= gmake go +GO_PKGNAME= github.com/${GH_ACCOUNT}/${GH_PROJECT} +GO_TARGETS= ${PORTNAME} + +USE_RC_SUBR= ${PORTNAME} + +do-build: + cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GMAKE} -C ${GO_TARGETS} + +do-install: + ${INSTALL_PROGRAM} ${GO_WRKSRC}/${GO_TARGETS}/${GO_TARGETS} \ + ${STAGEDIR}${PREFIX}/sbin + ${INSTALL_DATA} ${GO_WRKSRC}/${GO_TARGETS}/etc/${GO_TARGETS}.yml \ + ${STAGEDIR}${PREFIX}/etc/${GO_TARGETS}.yml.sample + +.include <bsd.port.mk> diff --git a/sysutils/filebeat/distinfo b/sysutils/filebeat/distinfo new file mode 100644 index 000000000000..f6a82339e164 --- /dev/null +++ b/sysutils/filebeat/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1464325885 +SHA256 (elastic-beats-v1.2.3_GH0.tar.gz) = 8eea85de415898c362144ba533062651d8891241c738799e54cc9b17040c1fc9 +SIZE (elastic-beats-v1.2.3_GH0.tar.gz) = 9922853 diff --git a/sysutils/filebeat/files/filebeat.in b/sysutils/filebeat/files/filebeat.in new file mode 100644 index 000000000000..56307d699a98 --- /dev/null +++ b/sysutils/filebeat/files/filebeat.in @@ -0,0 +1,36 @@ +#!/bin/sh +# $FreeBSD$ + +# PROVIDE: filebeat +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable logstash-forwarder: +# filebeat_enable (bool): Set to YES to enable filebeat +# Default: NO +# filebeat_flags (str): Extra flags passed to filebeat +# filebeat_conf (str): filebeat configuration file +# Default: ${PREFIX}/etc/filebeat.yml + +. /etc/rc.subr + +name="filebeat" +rcvar=${name}_enable +load_rc_config $name + +: ${filebeat_enable:="NO"} +: ${filebeat_config:="%%PREFIX%%/etc/${name}.yml"} + +# daemon +start_precmd=filebeat_prestart +command=/usr/sbin/daemon +pidfile="/var/run/${name}" +command_args="-rP ${pidfile} %%PREFIX%%/sbin/${name} -c ${filebeat_config}" + +filebeat_prestart() { +# Have to empty rc_flags so they don't get passed to daemon(8) + rc_flags="" +} + +run_rc_command "$1" diff --git a/sysutils/filebeat/files/patch-libbeat_scripts_Makefile b/sysutils/filebeat/files/patch-libbeat_scripts_Makefile new file mode 100644 index 000000000000..0d589d1d8ac4 --- /dev/null +++ b/sysutils/filebeat/files/patch-libbeat_scripts_Makefile @@ -0,0 +1,11 @@ +--- libbeat/scripts/Makefile.orig 2016-02-11 14:04:40 UTC ++++ libbeat/scripts/Makefile +@@ -6,7 +6,7 @@ ARCH?=$(shell uname -m) + export PATH := ./bin:$(PATH) + export GO15VENDOREXPERIMENT=1 + GOFILES = $(shell find . -type f -name '*.go') +-SHELL=/bin/bash ++SHELL=/bin/sh + ES_HOST?="elasticsearch-210" + BEAT_DIR?=github.com/elastic/beats + BUILD_DIR=build diff --git a/sysutils/filebeat/pkg-descr b/sysutils/filebeat/pkg-descr new file mode 100644 index 000000000000..8f681c919c1a --- /dev/null +++ b/sysutils/filebeat/pkg-descr @@ -0,0 +1,13 @@ +Beats is the platform for building lightweight, open source data +shippers for many types of operational data you want to enrich with +Logstash, search and analyze in Elasticsearch, and visualize in Kibana. +Whether you're interested in log files, infrastructure metrics, network +packets, or any other type of data, Beats serves as the foundation for +keeping a beat on your data. + +Filebeat is a lightweight, open source shipper for log file data. As the +next-generation Logstash Forwarder, Filebeat tails logs and quickly +sends this information to Logstash for further parsing and enrichment or +to Elasticsearch for centralized storage and analysis. + +WWW: https://www.elastic.co/products/beats/filebeat diff --git a/sysutils/filebeat/pkg-plist b/sysutils/filebeat/pkg-plist new file mode 100644 index 000000000000..38ff5f8c2ea6 --- /dev/null +++ b/sysutils/filebeat/pkg-plist @@ -0,0 +1,2 @@ +sbin/filebeat +@sample etc/filebeat.yml.sample diff --git a/sysutils/packetbeat/Makefile b/sysutils/packetbeat/Makefile new file mode 100644 index 000000000000..e43fa2a8c187 --- /dev/null +++ b/sysutils/packetbeat/Makefile @@ -0,0 +1,35 @@ +# Created by: Palle Girgensohn <girgen@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= packetbeat +PORTVERSION= 1.2.3 +DISTVERSIONPREFIX=v +CATEGORIES= sysutils + +MAINTAINER= girgen@FreeBSD.org +COMMENT= Elasticsearch real-time network packet analytics + +LICENSE= APACHE20 + +#BUILD_DEPENDS= go:lang/go + +USE_GITHUB= yes +GH_ACCOUNT= elastic +GH_PROJECT= beats + +USES= gmake go +GO_PKGNAME= github.com/${GH_ACCOUNT}/${GH_PROJECT} +GO_TARGETS= ${PORTNAME} + +USE_RC_SUBR= ${PORTNAME} + +do-build: + cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GMAKE} -C ${GO_TARGETS} + +do-install: + ${INSTALL_PROGRAM} ${GO_WRKSRC}/${GO_TARGETS}/${GO_TARGETS} \ + ${STAGEDIR}${PREFIX}/sbin + ${INSTALL_DATA} ${GO_WRKSRC}/${GO_TARGETS}/etc/${GO_TARGETS}.yml \ + ${STAGEDIR}${PREFIX}/etc/${GO_TARGETS}.yml.sample + +.include <bsd.port.mk> diff --git a/sysutils/packetbeat/distinfo b/sysutils/packetbeat/distinfo new file mode 100644 index 000000000000..71908a5ce6ae --- /dev/null +++ b/sysutils/packetbeat/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1464325900 +SHA256 (elastic-beats-v1.2.3_GH0.tar.gz) = 8eea85de415898c362144ba533062651d8891241c738799e54cc9b17040c1fc9 +SIZE (elastic-beats-v1.2.3_GH0.tar.gz) = 9922853 diff --git a/sysutils/packetbeat/files/packetbeat.in b/sysutils/packetbeat/files/packetbeat.in new file mode 100644 index 000000000000..9d106e5db279 --- /dev/null +++ b/sysutils/packetbeat/files/packetbeat.in @@ -0,0 +1,37 @@ +#!/bin/sh +# $FreeBSD$ + +# PROVIDE: packetbeat +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable packetbeat +# +# packetbeat_enable (bool): Set to YES to enable packetbeat +# Default: NO +# packetbeat_flags (str): Extra flags passed to packetbeat +# packetbeat_conf (str): packetbeat configuration file +# Default: ${PREFIX}/etc/packetbeat.yml + +. /etc/rc.subr + +name="packetbeat" +rcvar=${name}_enable +load_rc_config $name + +: ${packetbeat_enable:="NO"} +: ${packetbeat_config:="%%PREFIX%%/etc/${name}.yml"} + +# daemon +start_precmd=packetbeat_prestart +command=/usr/sbin/daemon +pidfile="/var/run/${name}" +command_args="-rP ${pidfile} %%PREFIX%%/sbin/${name} -c ${packetbeat_config}" + +packetbeat_prestart() { +# Have to empty rc_flags so they don't get passed to daemon(8) + rc_flags="" +} + +run_rc_command "$1" diff --git a/sysutils/packetbeat/files/patch-libbeat_scripts_Makefile b/sysutils/packetbeat/files/patch-libbeat_scripts_Makefile new file mode 100644 index 000000000000..0d589d1d8ac4 --- /dev/null +++ b/sysutils/packetbeat/files/patch-libbeat_scripts_Makefile @@ -0,0 +1,11 @@ +--- libbeat/scripts/Makefile.orig 2016-02-11 14:04:40 UTC ++++ libbeat/scripts/Makefile +@@ -6,7 +6,7 @@ ARCH?=$(shell uname -m) + export PATH := ./bin:$(PATH) + export GO15VENDOREXPERIMENT=1 + GOFILES = $(shell find . -type f -name '*.go') +-SHELL=/bin/bash ++SHELL=/bin/sh + ES_HOST?="elasticsearch-210" + BEAT_DIR?=github.com/elastic/beats + BUILD_DIR=build diff --git a/sysutils/packetbeat/pkg-descr b/sysutils/packetbeat/pkg-descr new file mode 100644 index 000000000000..ee80f4f16cdc --- /dev/null +++ b/sysutils/packetbeat/pkg-descr @@ -0,0 +1,12 @@ +Beats is the platform for building lightweight, open source data +shippers for many types of operational data you want to enrich with +Logstash, search and analyze in Elasticsearch, and visualize in Kibana. +Whether you're interested in log files, infrastructure metrics, network +packets, or any other type of data, Beats serves as the foundation for +keeping a beat on your data. + +Packetbeat is the open source data shipper that integrates with +Elasticsearch and Kibana to provide real-time analytics for web, +database, and other network protocols. + +WWW: https://www.elastic.co/products/beats/packetbeat diff --git a/sysutils/packetbeat/pkg-plist b/sysutils/packetbeat/pkg-plist new file mode 100644 index 000000000000..2922f55189ee --- /dev/null +++ b/sysutils/packetbeat/pkg-plist @@ -0,0 +1,2 @@ +sbin/packetbeat +@sample etc/packetbeat.yml.sample |