mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Start working on a concurrent stream test for the multiline filter
This commit is contained in:
parent
fbe0aff1e0
commit
b273699f14
1 changed files with 31 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue