Compare multiple types in if in logstash


(Luvpreet Singh) #1

What is the proper syntax of comparing multiple types in logstash ?

like,

if[type] == grafana OR netdata {  # is this correct ?
 }
else if[type] == {
}
else {
}

(Magnus B├Ąck) #2

Either

if [type] == "grafana" OR [type] == "netdata" { 

or

if [type] in ["grafana", "netdata"] { 

See https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html.


(system) #3

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