Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- So, this is my output configuration:
- > output
- > {
- >
- >
- >
- >
- > if [field] == "ABC" and [Properly_Formatted] == "Yes"
- > {
- > elasticsearch
- > {
- > hosts => "localhost:9200"
- > user => "xxx"
- > password => "xxx"
- > index => "abc"
- > }
- > }
- >
- > else if [field] == "DEF" and [Properly_Formatted] == "Yes"
- > {
- > elasticsearch
- > {
- > hosts => "localhost:9200"
- > user => "xxx"
- > password => "xxx"
- > index => "def"
- > }
- > }
- >
- > else
- > {
- > elasticsearch
- > {
- > hosts => "localhost:9200"
- > user => "xxx"
- > password => "xxx"
- > index => "other"
- > }
- > }
- >
- > stdout
- > {
- > codec => rubydebug
- > }
- > }
- Everything work good, if field exist it's throwing my logs to properly indices.
- But the error show up, when the field has another value than "abc" or "def".
- Output config say us that, for example: log with field with value "xyz" should go to index "other",
- but log didn't appear there, and in logstash stdout i can find error:
- > "error"=>{"type"=>"mapper_parsing_exception",
- > "reason"=>"failed to parse [field]", "caused_by"=>{"type"=>"number_format_exception",
- > "reason"=>"For input string: \"xyz\""}}}}, :level=>:warn}
- I'm pretty sure that, this error is related to output config.
- If statement didn't work properly?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement