elastic / elastic/logstash

`Event#remove` doesn't work with @metadata

Open
#3,538 1 comment 0 reactions 0 assignees View on GitHub
bug code cleanup
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
1d 4h
Merged PRs (30d)
88

Description

@andrewvc found this issue when working on the http poller.

If you save any information in the `@metadata` field and try to rename the key with the mutate filter.
The filter will create the target field with a nil value and the data will remain with the `@metadata`
The mutate filter actually use the `#remove` method to remove and return the value of the key.
But the current implementation only give access to the `accessors` hash, which include all the `non-metadata` field

See:
https://github.com/elastic/logstash/blob/master/lib/logstash/event.rb#L203

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.