Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplus/manifests/log/tracker.pp

Issue 29339248: Issue 3305 - Introduce adblockplus::log::tracker and ::forwarder (Closed)
Patch Set: Issue 3305 - Fix typos in documentation Created April 7, 2016, 7:29 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: modules/adblockplus/manifests/log/tracker.pp
diff --git a/modules/adblockplus/manifests/log/tracker.pp b/modules/adblockplus/manifests/log/tracker.pp
new file mode 100644
index 0000000000000000000000000000000000000000..6ba268a2c0b3d961602fb57d889fd470a4551752
--- /dev/null
+++ b/modules/adblockplus/manifests/log/tracker.pp
@@ -0,0 +1,59 @@
+# == Type: adblockplus::log::tracker
+#
+# Establish monitoring for a single log-file source on the current node,
+# connected to the adblockplus::log::forwarder output, if any.
+#
+# === Parameters:
+#
+# [*ensure*]
+# Whether the tracker is supposed to be 'present' or 'absent', defaults
+# to $adblockplus::log::ensure.
+#
+# [*format*]
+# Either the name of a pre-configured format specific to the (Fluentd)
+# system setup or a regular expression with named groups for extracting
+# the log event's properties.
+#
+# [*name*]
+# Translates literally into a tag attached to the tracked log event.
+#
+# [*path*]
+# The full path to the log file being tracked, required to be unique.
+#
+# === Examples:
+#
+# adblockplus::log::tracker {'example1':
+# format => 'nginx',
+# name => 'foobar.access',
+# path => '/var/log/nginx/access.log',
+# }
+#
+# adblockplus::log::tracker {'example2':
+# path => '/var/log/nginx/error.log',
+# name => 'foobar.error',
+# format => '/^(?<message>.+)$/',
+# }
+#
+# adblockplus::log::tracker {'/var/log/other.log':
+# ensure => 'absent',
+# }
+#
+define adblockplus::log::tracker (
+ $ensure = undef,
+ $format = '/^(?<message>.*)$/',
+ $path = $title,
+) {
+
+ include adblockplus::log::forwarder
+ include stdlib
+
+ # Used as $title for all resource definitions contained herein
+ $namevar = "adblockplus::log::tracker#$title"
+
+ # See modules/fluent/manifests/config.pp
+ fluent::config {$namevar:
+ content => template('adblockplus/log/fluentd/tracker.conf.erb'),
+ ensure => pick($ensure, $adblockplus::log::ensure),
+ name => sprintf('20-adblockplus-log-tracker-%s', md5($path)),
+ }
+}
« no previous file with comments | « modules/adblockplus/manifests/log/forwarder.pp ('k') | modules/adblockplus/templates/log/fluentd/default.conf.erb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld