puppet-filebeat
puppet-filebeat copied to clipboard
Filebeat inputs - Support subfields on fields section (relative to ecs support)
Fix code to support ability to set sub fields on fields section. Actually, we can only set key and value.
Actually supported:
fields:
type: apache_access
Actually not supported:
fields:
event:
dataset: apache_access
Maybe we can replace this:
<%- if @fields.length > 0 -%>
fields:
<%- @fields.each_pair do |k, v| -%>
<%= k %>: <%= v %>
<%- end -%>
<%- end -%>
by:
<%- if @fields.length > 0 -%>
fields:
<%- %><%= @fields.to_yaml.lines.drop(1).join.gsub(/^/, ' ') -%>
<%- end -%>
I think a lot of changes like this are going to be supported when we merge #236.
There is a workaround to this issue which still exists today:
fields => { 'my.nested.field.key' => 'value' }
The pull request #236 seems not permit to use pure_array when use create_ressource(filebeat::input, $filebeat_apache), because of it not use field on class filebeat::input::inputs, but field on filebeat::inputs