mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- Add test case to identify exceptions coming from the date filter.
Covers LOGSTASH-705
This commit is contained in:
parent
47042892de
commit
82988a63b5
1 changed files with 16 additions and 7 deletions
|
@ -134,20 +134,29 @@ describe LogStash::Filters::Date do
|
|||
end
|
||||
|
||||
describe "failed parses should not cause a failure (LOGSTASH-641)" do
|
||||
config <<-CONFIG
|
||||
config <<-'CONFIG'
|
||||
input {
|
||||
generator {
|
||||
lines => [
|
||||
'{ "@fields": { "mydate": "this will not parse" } }',
|
||||
'{ "@fields": { } }'
|
||||
]
|
||||
format => json_event
|
||||
type => foo
|
||||
count => 1
|
||||
}
|
||||
}
|
||||
filter {
|
||||
date {
|
||||
mydate => [ "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
|
||||
}
|
||||
}
|
||||
output {
|
||||
null { }
|
||||
}
|
||||
CONFIG
|
||||
|
||||
sample "@fields" => { "mydate" => "this will not parse" } do
|
||||
# nothing to do, if this crashes it's an error..
|
||||
end
|
||||
|
||||
# No 'mydate' field at all
|
||||
sample "@fields" => { } do
|
||||
agent do
|
||||
# nothing to do, if this crashes it's an error..
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue