- add tests to cover grok singles with duplicate field names

This commit is contained in:
Jordan Sissel 2013-09-06 18:04:28 -07:00
parent 4155a8bc0e
commit 1ceeed8628

View file

@ -409,4 +409,23 @@ describe LogStash::Filters::Grok do
end
end
end
describe "singles with duplicate-named fields" do
config <<-CONFIG
filter {
grok {
match => [ "message", "%{INT:foo}|%{WORD:foo}" ]
singles => true
}
}
CONFIG
sample "hello world" do
insist { subject["foo"] }.is_a?(String)
end
sample "123 world" do
insist { subject["foo"] }.is_a?(String)
end
end
end