Start working on a concurrent stream test for the multiline filter

This commit is contained in:
Jordan Sissel 2012-10-11 16:06:47 -07:00
parent fbe0aff1e0
commit b273699f14

View file

@ -41,4 +41,35 @@ describe LogStash::Filters::Multiline do
insist { subject[0].message } == "120913 12:04:33 first line\nsecond line\nthird line"
end
end
describe "multiline safety among multiple concurrent streams" do
# The logstash config goes here.
# At this time, only filters are supported.
config <<-CONFIG
filter {
multiline {
pattern => "^\s"
what => previous
}
}
CONFIG
multiline_event = [
"hello world",
" line 2",
" line 3",
" line 4",
" line 5",
]
# generate 20 independent streams of this same event, possibly repeated multiple times in each stream
eventstream = 20.times.collect do |stream|
multiline_event.collect { |line| LogStash::Event.new("@message" => line, "@type" => stream.to_s) }
end
sample eventstream do
require "pry"
binding.pry
end
end
end