Logstash or condition in if statement


(musa) #1

Hi guys,

i want to check multiple condition in if statement.

my filter like that but it is not working. it pass everything :slight_smile: it worked when i was only one condition.

1 ) doesnt work ->
if [logid] == "%LINK-3-UPDOWN" or "%ETHPORT-5-IF_DOWN_LINK_FAILURE" or "%ETH_PORT_CHANNEL-5-PORT_DOWN"

  1. workb->
    if [logid] == "%LINK-3-UPDOWN"

sincerely


(Magnus Bรคck) #2

You need this:

if [logid] == "%LINK-3-UPDOWN" or [logid] == "%ETHPORT-5-IF_DOWN_LINK_FAILURE" or [logid] == "%ETH_PORT_CHANNEL-5-PORT_DOWN"

If condition statement in Logstash
(musa) #3

thank you magnus. that is definitly works.


(system) #4

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