mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Update configuration.md
Show an example of conditionals that just check the presence of a field. It's not immediately obvious how to do this from the existing docs. Fixes #2442
This commit is contained in:
parent
fbf8e1e320
commit
940b90c32b
1 changed files with 7 additions and 0 deletions
|
@ -278,6 +278,13 @@ You can also do multiple expressions in a single condition:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
You can test whether a field was present, regardless of its value:
|
||||
|
||||
if [exception_message] {
|
||||
# If the event has an exception_message field, set the level
|
||||
mutate { add_field => { "level" => "ERROR" } }
|
||||
}
|
||||
|
||||
Here are some examples for testing with the in conditional:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue