1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2025-09-11 16:19:29 +00:00

Extend templates for fluentd 0.14 new sections

- extend source to support format and parse section
- extend match to support buffers with chunk keys
- update readme
This commit is contained in:
Robert Waffen
2017-11-11 12:40:33 +01:00
parent 71352ea6b1
commit 45449583d9
3 changed files with 68 additions and 7 deletions

View File

@@ -1,7 +1,8 @@
<match <%= @pattern %>>
<% @config.each do |key, val| -%>
<%- if key == 'buffer_chunk_keys'; next; end-%>
<%- if val.is_a?( Hash ) -%>
<<%= key -%>>
<<%= key -%><%- if key == 'buffer' && !@config['buffer_chunk_keys'].nil? -%> <%= @config['buffer_chunk_keys'] -%><%- end -%>>
<%- val.each do |key, val| -%>
<%= key -%> <%= val %>
<%- end -%>
@@ -13,7 +14,7 @@
<%- k.each do |x, y| -%>
<%- if y.is_a?( Array ) -%>
<%- y.each do |a, b| -%>
<<%= x -%>>
<<%= x -%><%- if x == 'buffer' && !k['buffer_chunk_keys'].nil? -%> <%= k['buffer_chunk_keys'] -%><%- end -%>>
<%- if a.is_a?( Hash ) -%>
<%- a.each do |c, d| -%>
<%= c -%> <%= d %>
@@ -24,6 +25,7 @@
</<%= x %>>
<%- end -%>
<%- else -%>
<%- if x == 'buffer_chunk_keys'; next; end -%>
<%= x -%> <%= y %>
<%- end -%>
<%- end -%>

View File

@@ -1,5 +1,13 @@
<source>
<% @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 -%>
</source>