Or check in filter plugin


I have logstash configuration to get two types of inputs, one from File another from Beats.
So I'm setting type variable as "file_input" and "beats_input" respectively.

Next In the filter plugin, I have to have a if condition like below

if "file_input" in [type]{

which is working fine.

But in one place have to have a check both the input types..
So want to know how to have OR check in the if condition?

if ["file_input" || "beats_input"] in [type]{

Please advise .. Thanks in advance

You could do it using in as a test for array membership

if [type] in [ "file_input", "beat_input" ] 

Or you could do it like this

if [type] == "file_input" or [type] == "beat_input"

Thank you so much Badger..

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