Skip to content

Events' metadata hash is overwritten by headers and properties #98

Closed
@magnusbaeck

Description

@magnusbaeck

If add_field is used to add metadata fields, e.g. like

input {
  rabbitmq {
    ...
    add_field => {
      "[@metadata][indexType]" => "myindex"
    }
  }
}

those fields won't end up in the events produced by the input. This is a regression introduced in #83 when

event["@metadata"]["rabbitmq_headers"] = get_headers(metadata)
event["@metadata"]["rabbitmq_properties"] = get_properties(metadata)

was replaced by this:

meta = {
  "rabbitmq_headers" => get_headers(metadata),
   "rabbitmq_properties" => get_properties(metadata)
}
event.set("@metadata", meta)

This bug was originally reported here: https://discuss.elastic.co/t/rabbitmq-input-plugin-add-field-doesnt-write-metadata/82152

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