| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 # == Type: adblockplus::log::tracker | 
|  | 2 # | 
|  | 3 # Establish monitoring for a single log-file source on the current node, | 
|  | 4 # connected to the adblockplus::log::forwarder output, if any. | 
|  | 5 # | 
|  | 6 # === Parameters: | 
|  | 7 # | 
|  | 8 # [*ensure*] | 
|  | 9 #   Whether the tracker is supposed to be 'present' or 'absent', defaults | 
|  | 10 #   to $adblockplus::log::ensure. | 
|  | 11 # | 
|  | 12 # [*format*] | 
|  | 13 #   Either the name of a pre-configured format specific to the (Fluentd) | 
|  | 14 #   system setup or a regular expression with named groups for extracting | 
|  | 15 #   the log event's properties. | 
|  | 16 # | 
|  | 17 # [*name*] | 
|  | 18 #   Translates literally into a tag attached to the tracked log event. | 
|  | 19 # | 
|  | 20 # [*path*] | 
|  | 21 #   The full path to the log file being tracked, required to be unique. | 
|  | 22 # | 
|  | 23 # === Examples: | 
|  | 24 # | 
|  | 25 #   adblockplus::log::tracker {'example1': | 
|  | 26 #     format => 'nginx', | 
|  | 27 #     name => 'foobar.access', | 
|  | 28 #     path => '/var/log/nginx/access.log', | 
|  | 29 #   } | 
|  | 30 # | 
|  | 31 #   adblockplus::log::tracker {'example2': | 
|  | 32 #     path => '/var/log/nginx/error.log', | 
|  | 33 #     name => 'foobar.error', | 
|  | 34 #     format => '/^(?<message>.+)$/', | 
|  | 35 #   } | 
|  | 36 # | 
|  | 37 #   adblockplus::log::tracker {'/var/log/other.log': | 
|  | 38 #     ensure => 'absent', | 
|  | 39 #   } | 
|  | 40 # | 
|  | 41 define adblockplus::log::tracker ( | 
|  | 42   $ensure = undef, | 
|  | 43   $format = '/^(?<message>.*)$/', | 
|  | 44   $path = $title, | 
|  | 45 ) { | 
|  | 46 | 
|  | 47   include adblockplus::log::forwarder | 
|  | 48   include stdlib | 
|  | 49 | 
|  | 50   # Used as $title for all resource definitions contained herein | 
|  | 51   $namevar = "adblockplus::log::tracker#$title" | 
|  | 52 | 
|  | 53   # See modules/fluent/manifests/config.pp | 
|  | 54   fluent::config {$namevar: | 
|  | 55     content => template('adblockplus/log/fluentd/tracker.conf.erb'), | 
|  | 56     ensure => pick($ensure, $adblockplus::log::ensure), | 
|  | 57     name => sprintf('20-adblockplus-log-tracker-%s', md5($path)), | 
|  | 58   } | 
|  | 59 } | 
| OLD | NEW | 
|---|