1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-09-20 04:30:36 +00:00

added fluentd::filter definition

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

14
manifests/filter.pp Normal file
View File

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

13
templates/filter.erb Normal file
View File

@ -0,0 +1,13 @@
<filter <%= @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 -%>
</filter>