mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- hand-merge #485's test
This commit is contained in:
parent
34c5832d24
commit
b1395d8614
1 changed files with 23 additions and 0 deletions
|
@ -93,4 +93,27 @@ describe LogStash::Filters::Multiline, :if => false do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "multiline add/remove tags and fields only when matched" do
|
||||
config <<-CONFIG
|
||||
filter {
|
||||
mutate {
|
||||
add_tag => "dummy"
|
||||
}
|
||||
multiline {
|
||||
add_tag => [ "nope" ]
|
||||
remove_tag => "dummy"
|
||||
add_field => [ "dummy2", "value" ]
|
||||
pattern => "an unlikely match"
|
||||
what => previous
|
||||
}
|
||||
}
|
||||
CONFIG
|
||||
|
||||
sample [ "120913 12:04:33 first line", "120913 12:04:33 second line" ] do
|
||||
subject.each do |s|
|
||||
insist { s.tags.find_index("nope").nil? && s.tags.find_index("dummy") != nil && !s.fields.has_key?("dummy2") } == true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue