logstash expression

if EXPRESSION {

} else if EXPRESSION {

} else {

}

EXPRESSION are Comparison tests, boolean logic, etc.

Comparison operators:
equality: ==, !=, <, >, <=, >=
regexp: =~, !~ (checks a pattern on the right against a string value on the left)
inclusion: in, not in

boolean operators:
and, or, nand, xor

unary operator:
!

group with parentheses (…)

Any “value” contains in “tags”:

if “value” in [tags] {
}

Check String Field:

if [myFieldName] =~ /.+/ {
# exists
}

if [myFieldName] !~ /.+/ {
# doesn’t exist
}

Check Number Field:

if [myFieldName] {
# exists
}