Skip to content

Support bracketed target field name #33

@nickcarenza

Description

@nickcarenza

The argument for defining the target isn't like other logstash plugins (logstash-filter-geoip). It seems to require that I supply the field without surrounding brackets. If i use brackets, it silently adds the fields to the root of the event. Strangely however, if i target a nested field like [one][two] with the brackets, it does write the fields to that location. It is not obvious to me how this line allows that since the resulting normalized_target seems like it would be [[one][two]]. Maybe that is a valid target or I am misunderstanding what that line does.

Here is the config I expect to work but causes the filter to write fields to root:

    useragent {
      source => "[device][user_agent]"
      target => "[device]"
    }

Here is the config where I specify a deep path and the fields are successfully written to it as expected:

    useragent {
      source => "[device][user_agent]"
      target => "[device][test]"
    }

And here is the config I ended up using for this filter which works as intended but unlike other plugins in how target is specified:

    useragent {
      source => "[device][user_agent]"
      target => "device"
    }

This is with version 2.0.8 but the line of the code that seems to matter looks the same on master.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions