mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-12-16 13:20:35 +00:00
added fluentd::filter definition
This commit is contained in:
parent
ce9a65a4e4
commit
4c880b1a9b
14
manifests/filter.pp
Normal file
14
manifests/filter.pp
Normal 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
13
templates/filter.erb
Normal 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>
|
Loading…
Reference in New Issue
Block a user