- make LogStash::Event#clone a deeper copy. Required otherwise the

'fields' element is shared, etc.
This commit is contained in:
Jordan Sissel 2011-08-17 01:08:16 -07:00
parent 90580469ec
commit a721d797ea

View file

@ -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