1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-11-13 21:50:34 +00:00

added fluentd::match definition

This commit is contained in:
Max Wilhelm 2015-12-01 14:19:18 +01:00
parent 4c880b1a9b
commit 49857ddb1d
2 changed files with 27 additions and 0 deletions

14
manifests/match.pp Normal file
View File

@ -0,0 +1,14 @@
# Configure a fluentd match
#
define fluentd::match (
$ensure = present,
$priority = 30,
$pattern = '',
$config = {},
) {
fluentd::config::file { "match-${title}":
ensure => $ensure,
priority => $priority,
content => template( 'fluentd/match.erb'),
}
}

13
templates/match.erb Normal file
View File

@ -0,0 +1,13 @@
<match <%= @pattern %>>
<% @config.each do |key, val| -%>
<%- if val.is_a?( Hash ) -%>
<<%= key -%>>
<%- val.each do |key, val| -%>
<%= key -%> <%= val %>
<%- end -%>
</<%= key %>>
<%- else -%>
<%= key -%> <%= val %>
<%- end -%>
<% end -%>
</match>