mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Merge pull request #1158 from darren-fhf/master
Fix bug LOGSTASH-1225 "Cannot Clone Fixnum"
This commit is contained in:
commit
d30a9e5bfc
2 changed files with 17 additions and 1 deletions
|
@ -85,7 +85,7 @@ class LogStash::Event
|
||||||
copy = {}
|
copy = {}
|
||||||
@data.each do |k,v|
|
@data.each do |k,v|
|
||||||
# TODO(sissel): Recurse if this is a hash/array?
|
# TODO(sissel): Recurse if this is a hash/array?
|
||||||
copy[k] = v.clone
|
copy[k] = begin v.clone rescue v end
|
||||||
end
|
end
|
||||||
return self.class.new(copy)
|
return self.class.new(copy)
|
||||||
end # def clone
|
end # def clone
|
||||||
|
|
|
@ -64,4 +64,20 @@ describe LogStash::Filters::Clone do
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "Bug LOGSTASH-1225" do
|
||||||
|
### LOGSTASH-1225: Cannot clone events containing numbers.
|
||||||
|
config <<-CONFIG
|
||||||
|
filter {
|
||||||
|
clone {
|
||||||
|
clones => [ 'clone1' ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CONFIG
|
||||||
|
|
||||||
|
sample("type" => "bug-1225", "message" => "unused", "number" => 5) do
|
||||||
|
insist { subject[0]["number"] } == 5
|
||||||
|
insist { subject[1]["number"] } == 5
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue