puppet-filebeat icon indicating copy to clipboard operation
puppet-filebeat copied to clipboard

Filebeat inputs - Support subfields on fields section (relative to ecs support)

Open disaster37 opened this issue 5 years ago • 3 comments

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 -%>

disaster37 avatar Jan 17 '20 13:01 disaster37

I think a lot of changes like this are going to be supported when we merge #236.

pcfens avatar Jan 17 '20 16:01 pcfens

There is a workaround to this issue which still exists today:

fields => { 'my.nested.field.key' => 'value' }

jbehrends avatar Jun 10 '20 17:06 jbehrends

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

disaster37 avatar Jan 15 '21 10:01 disaster37