Logs are not passing into the if and else if condition

my logs are not passing into the if and else if condition, when the if is removed it works fine.
logstash 7.1.1

> filter {
>         if [source] =~ "gid" {
>          grok {
>             match => {"message" => "%{TIMESTAMP_ISO8601:timestamp}\|(\[%{BASE10NUM:nbr}\])\|%{IPORHOST:ClientIP}\|%{USERNAME:User};%{DATA:Node}\|%{URIPATH:Url}\|%{NOTS$
>          }
>         }
> }

Try this:

if [source] and [source] == "gid" {
BLAH
}

it's not working :frowning_face:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.