hello~
Is it possible to use "nested else if" in filter section inside logstash.conf
logstash 7.10.2
example
else if ... {
if ...{
else if .... {
....
}
}
}
hello~
Is it possible to use "nested else if" in filter section inside logstash.conf
logstash 7.10.2
example
else if ... {
if ...{
else if .... {
....
}
}
}
Yes, it's possible in 7.x, check documentation. Pay attention on curly brackets, with too many IFs, things can be messy.
if [field1]=="something"{
if ( [field2]=="value1" or [field2]=="valu2" ){
...
}
}
else if "value" in [tags]{
...}
else {
...
}
Also you can use IFs in the output section.
oh thanks but that means,
** else if inside if * becuase it's not working
if [field1] == "somthing"{
...
}
else if [field1]=="something"{
if ( [field2]=="value1" or [field2]=="valu2" ){
...
}
}
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.