mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- make LogStash::Event#clone a deeper copy. Required otherwise the
'fields' element is shared, etc.
This commit is contained in:
parent
90580469ec
commit
a721d797ea
1 changed files with 6 additions and 1 deletions
|
@ -40,7 +40,12 @@ class LogStash::Event
|
|||
|
||||
public
|
||||
def clone
|
||||
return LogStash::Event.new(@data.clone)
|
||||
newdata = @data.clone
|
||||
newdata["@fields"] = {}
|
||||
fields.each do |k,v|
|
||||
newdata["@fields"][k] = v.clone
|
||||
end
|
||||
return LogStash::Event.new(newdata)
|
||||
end # def clone
|
||||
|
||||
public
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue