From: William Hubbs Date: Tue, 10 Apr 2018 00:52:48 +0000 (-0500) Subject: app-admin/fluentd: new package, data collector and unified logging layer X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=4340ad2606cb5ffba23e93b01f5c9ae323ff2efd;p=gentoo.git app-admin/fluentd: new package, data collector and unified logging layer Package-Manager: Portage-2.3.24, Repoman-2.3.6 --- diff --git a/app-admin/fluentd/Manifest b/app-admin/fluentd/Manifest new file mode 100644 index 000000000000..c2468e2b9ea4 --- /dev/null +++ b/app-admin/fluentd/Manifest @@ -0,0 +1 @@ +DIST fluentd-1.1.3.gem 413184 BLAKE2B facda41a26f9fe4f55a4ae6f97336acaa818534b6ac8740badcb132a18497e8767723e931bb2506843b56208deaf41cdaf9ac81821618cb223b8035527d355d7 SHA512 0d17668c06e515219a39ddc7ecda6b5ec5d29e7d4d3799e3447034ad731568d870ac3d36d468be21b6ef7a4198353c3045872902c41a54c0c2eacad8ec12f357 diff --git a/app-admin/fluentd/files/fluent.conf b/app-admin/fluentd/files/fluent.conf new file mode 100644 index 000000000000..099d1b4af47d --- /dev/null +++ b/app-admin/fluentd/files/fluent.conf @@ -0,0 +1,139 @@ +# In v1 configuration, type and id are @ prefix parameters. +# @type and @id are recommended. type and id are still available for backward compatibility + +## built-in TCP input +## $ echo | fluent-cat +# +# @type forward +# @id forward_input +# + +## built-in UNIX socket input +# +# @type unix +# + +# HTTP input +# http://localhost:8888/?json= +# +# @type http +# @id http_input + +# port 8888 +# + +## File input +## read apache logs with tag=apache.access +# +# @type tail +# format apache +# path /var/log/httpd-access.log +# tag apache.access +# + +## Mutating event filter +## Add hostname and tag fields to apache.access tag events +# +# @type record_transformer +# +# hostname ${hostname} +# tag ${tag} +# +# + +## Selecting event filter +## Remove unnecessary events from apache prefixed tag events +# +# @type grep +# include1 method GET # pass only GET in 'method' field +# exclude1 message debug # remove debug event +# + +# Listen HTTP for monitoring +# http://localhost:24220/api/plugins +# http://localhost:24220/api/plugins?type=TYPE +# http://localhost:24220/api/plugins?tag=MYTAG +# +# @type monitor_agent +# @id monitor_agent_input + +# port 24220 +# + +# Listen DRb for debug +# +# @type debug_agent +# @id debug_agent_input + +# bind 127.0.0.1 +# port 24230 +# + +## match tag=apache.access and write to file +# +# @type file +# path /var/log/fluent/access +# + +## match tag=debug.** and dump to console + + @type stdout + @id stdout_output + + +# match tag=system.** and forward to another fluent server +# +# @type forward +# @id forward_output + +# +# host 192.168.0.11 +# +# +# +# host 192.168.0.12 +# +# +# + +## match tag=myapp.** and forward and write to file +# +# @type copy +# +# @type forward +# buffer_type file +# buffer_path /var/log/fluent/myapp-forward +# retry_limit 50 +# flush_interval 10s +# +# host 192.168.0.13 +# +# +# +# @type file +# path /var/log/fluent/myapp +# +# + +## match fluent's internal events +# +# @type null +# + +## match not matched logs and write to file +# +# @type file +# path /var/log/fluent/else +# compress gz +# + +## Label: For handling complex event routing +# diff --git a/app-admin/fluentd/files/fluentd.confd b/app-admin/fluentd/files/fluentd.confd new file mode 100644 index 000000000000..c693e6289b8a --- /dev/null +++ b/app-admin/fluentd/files/fluentd.confd @@ -0,0 +1,2 @@ +# If you need to pass any extra options to fluentd, set them here. +#fluentd_opts="" diff --git a/app-admin/fluentd/files/fluentd.initd b/app-admin/fluentd/files/fluentd.initd new file mode 100644 index 000000000000..c3e4a41f7deb --- /dev/null +++ b/app-admin/fluentd/files/fluentd.initd @@ -0,0 +1,12 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +command=/usr/bin/fluentd +pidfile=/var/run/fluentd.pid +command_args="--daemon ${pidfile} --no-supervisor ${fluent_opts}" +command_background=yes + +start_pre() { +fluentd -q --dry-run +} diff --git a/app-admin/fluentd/fluentd-1.1.3.ebuild b/app-admin/fluentd/fluentd-1.1.3.ebuild new file mode 100644 index 000000000000..68a253aeeff6 --- /dev/null +++ b/app-admin/fluentd/fluentd-1.1.3.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +USE_RUBY="ruby23 ruby24 ruby25" + +inherit ruby-fakegem user + +DESCRIPTION="data collector and unified logging layer (project under CNCF)" +HOMEPAGE="https://www.fluentd.org" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" + +ruby_add_rdepend " + >=dev-ruby/msgpack-0.7.0 + >=dev-ruby/yajl-ruby-1.0 + >=dev-ruby/coolio-1.4.5 + >=dev-ruby/serverengine-2.0.4 + >=dev-ruby/http_parser_rb-0.5.1 + >=dev-ruby/sigdump-0.2.2 + >=dev-ruby/tzinfo-1.0 + >=dev-ruby/strptime-0.2.2" + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 -1 -1 ${PN} +} + +all_ruby_prepare() { + sed -i \ + -e '/tzinfo-data/d' \ + -e '/dig_rb/d' \ + "${PN}".gemspec || die "'sed failed" +} + +all_ruby_install() { + all_fakegem_install + insinto /etc/fluent + doins "${FILESDIR}"/fluent.conf +newconfd "${FILESDIR}"/${PN}.confd ${PN} +newinitd "${FILESDIR}"/${PN}.initd ${PN} +} + +pkg_postinst() { + if [[ -z "${REPLACING_VERSIONS}" ]]; then + elog "A default configuration file has been installed in" + elog "${EROOT}etc/fluent/fluent.conf. You will need to edit" + elog "this file to match your configuration." + fi +} diff --git a/app-admin/fluentd/metadata.xml b/app-admin/fluentd/metadata.xml new file mode 100644 index 000000000000..1fbe5854b306 --- /dev/null +++ b/app-admin/fluentd/metadata.xml @@ -0,0 +1,17 @@ + + + + + williamh@gentoo.org + William Hubbs + + + ruby@gentoo.org + Gentoo Ruby Project + + + Fluentd is an open source data collector which lets you unify + the data collection and consumption for a better use and + understanding of data. + +