mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Merge branch 'imap_header_repetition' of https://github.com/colinsurprenant/logstash into colinsurprenant-imap_header_repetition
Conflicts: lib/logstash/inputs/imap.rb
This commit is contained in:
commit
61c2fdd765
1 changed files with 26 additions and 0 deletions
|
@ -59,4 +59,30 @@ describe LogStash::Inputs::IMAP do
|
|||
end
|
||||
end
|
||||
|
||||
context "with multiple values for same header" do
|
||||
it "should add 2 values as array in event" do
|
||||
msg.received = "test1"
|
||||
msg.received = "test2"
|
||||
|
||||
config = {"type" => "imap", "host" => "localhost",
|
||||
"user" => "#{user}", "password" => "#{password}"}
|
||||
|
||||
input = LogStash::Inputs::IMAP.new config
|
||||
input.register
|
||||
event = input.parse_mail(msg)
|
||||
insist { event["received"] } == ["test1", "test2"]
|
||||
end
|
||||
|
||||
it "should add more than 2 values as array in event" do
|
||||
msg.received = "test3"
|
||||
|
||||
config = {"type" => "imap", "host" => "localhost",
|
||||
"user" => "#{user}", "password" => "#{password}"}
|
||||
|
||||
input = LogStash::Inputs::IMAP.new config
|
||||
input.register
|
||||
event = input.parse_mail(msg)
|
||||
insist { event["received"] } == ["test1", "test2", "test3"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue