Logstash: `LogStash::Event#clone` should also clone the `@metadata`

Created on 5 Feb 2016  路  7Comments  路  Source: elastic/logstash

The ruby event implements a custom #clone method, the code return a newly created object using the @data instance variable as the initial hash. This has the side effect of not cloning the @metadata, some filter use the clone and will drop any associated @metadata when the event goes through the filter chain.

original issue: https://github.com/logstash-plugins/logstash-filter-dns/issues/17
https://github.com/logstash-plugins/logstash-filter-dns/blob/master/lib/logstash/filters/dns.rb#L68

bug v2.3.0

Most helpful comment

5656 was merged into the 2.x branch but was never merged into 2.4.

2.4.0 was forked from d7bc5e1a54941e5f50eb9aa4b87d75d27b080a51 (according to git merge-base v2.4.1 2.x), and #5656 was only merged into the 2.x branch (by the Github merge button) and not backported to 2.4 branch (at least, not that I can see).

The org.logstash.Event.clone method in 5.x does not clone metadata either.

I have reopened this.

All 7 comments

5656 was merged into the 2.x branch but was never merged into 2.4.

2.4.0 was forked from d7bc5e1a54941e5f50eb9aa4b87d75d27b080a51 (according to git merge-base v2.4.1 2.x), and #5656 was only merged into the 2.x branch (by the Github merge button) and not backported to 2.4 branch (at least, not that I can see).

The org.logstash.Event.clone method in 5.x does not clone metadata either.

I have reopened this.

Has anything happened for 5.x clone filter yet?
I have just got hit by this bug.

@jordansissel Is anyone looking into this issue?

+1
This is very important to us as it breaks our ability to use the clone filter almost entirely.

I will deal with this tomorrow :)

fixed in #8291 and related backports

Was this page helpful?
0 / 5 - 0 ratings