commit:     4340ad2606cb5ffba23e93b01f5c9ae323ff2efd
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 10 00:52:48 2018 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Apr 10 00:53:22 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4340ad26

app-admin/fluentd: new package, data collector and unified logging layer

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 app-admin/fluentd/Manifest             |   1 +
 app-admin/fluentd/files/fluent.conf    | 139 +++++++++++++++++++++++++++++++++
 app-admin/fluentd/files/fluentd.confd  |   2 +
 app-admin/fluentd/files/fluentd.initd  |  12 +++
 app-admin/fluentd/fluentd-1.1.3.ebuild |  52 ++++++++++++
 app-admin/fluentd/metadata.xml         |  17 ++++
 6 files changed, 223 insertions(+)

diff --git a/app-admin/fluentd/Manifest b/app-admin/fluentd/Manifest
new file mode 100644
index 00000000000..c2468e2b9ea
--- /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 00000000000..099d1b4af47
--- /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 <json> | fluent-cat <tag>
+#<source>
+#  @type forward
+#  @id forward_input
+#</source>
+
+## built-in UNIX socket input
+#<source>
+#  @type unix
+#</source>
+
+# HTTP input
+# http://localhost:8888/<tag>?json=<json>
+#<source>
+#  @type http
+#  @id http_input
+
+#  port 8888
+#</source>
+
+## File input
+## read apache logs with tag=apache.access
+#<source>
+#  @type tail
+#  format apache
+#  path /var/log/httpd-access.log
+#  tag apache.access
+#</source>
+
+## Mutating event filter
+## Add hostname and tag fields to apache.access tag events
+#<filter apache.access>
+#  @type record_transformer
+#  <record>
+#    hostname ${hostname}
+#    tag ${tag}
+#  </record>
+#</filter>
+
+## Selecting event filter
+## Remove unnecessary events from apache prefixed tag events
+#<filter apache.**>
+#  @type grep
+#  include1 method GET # pass only GET in 'method' field
+#  exclude1 message debug # remove debug event
+#</filter>
+
+# Listen HTTP for monitoring
+# http://localhost:24220/api/plugins
+# http://localhost:24220/api/plugins?type=TYPE
+# http://localhost:24220/api/plugins?tag=MYTAG
+#<source>
+#  @type monitor_agent
+#  @id monitor_agent_input
+
+#  port 24220
+#</source>
+
+# Listen DRb for debug
+#<source>
+#  @type debug_agent
+#  @id debug_agent_input
+
+#  bind 127.0.0.1
+#  port 24230
+#</source>
+
+## match tag=apache.access and write to file
+#<match apache.access>
+#  @type file
+#  path /var/log/fluent/access
+#</match>
+
+## match tag=debug.** and dump to console
+<match debug.**>
+  @type stdout
+  @id stdout_output
+</match>
+
+# match tag=system.** and forward to another fluent server
+#<match system.**>
+#  @type forward
+#  @id forward_output
+
+#  <server>
+#    host 192.168.0.11
+#  </server>
+#  <secondary>
+#    <server>
+#      host 192.168.0.12
+#    </server>
+#  </secondary>
+#</match>
+
+## match tag=myapp.** and forward and write to file
+#<match myapp.**>
+#  @type copy
+#  <store>
+#    @type forward
+#    buffer_type file
+#    buffer_path /var/log/fluent/myapp-forward
+#    retry_limit 50
+#    flush_interval 10s
+#    <server>
+#      host 192.168.0.13
+#    </server>
+#  </store>
+#  <store>
+#    @type file
+#    path /var/log/fluent/myapp
+#  </store>
+#</match>
+
+## match fluent's internal events
+#<match fluent.**>
+#  @type null
+#</match>
+
+## match not matched logs and write to file
+#<match **>
+#  @type file
+#  path /var/log/fluent/else
+#  compress gz
+#</match>
+
+## Label: For handling complex event routing
+#<label @STAGING>
+#  <match system.**>
+#    @type forward
+#    @id staging_forward_output
+#    <server>
+#      host 192.168.0.101
+#    </server>
+#  </match>
+#</label>

diff --git a/app-admin/fluentd/files/fluentd.confd 
b/app-admin/fluentd/files/fluentd.confd
new file mode 100644
index 00000000000..c693e6289b8
--- /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 00000000000..c3e4a41f7de
--- /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 00000000000..68a253aeeff
--- /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 00000000000..1fbe5854b30
--- /dev/null
+++ b/app-admin/fluentd/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>willi...@gentoo.org</email>
+               <name>William Hubbs</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>r...@gentoo.org</email>
+               <name>Gentoo Ruby Project</name>
+       </maintainer>
+       <longdescription lang="en">
+               Fluentd is an open source data collector which lets you unify
+               the data collection and consumption for a better use and
+               understanding of data.
+       </longdescription>
+</pkgmetadata>

Reply via email to