# Multiple if conditions in output section-Logstash conf

**URL:** <https://discuss.elastic.co/t/multiple-if-conditions-in-output-section-logstash-conf/93972>\
**Category:** Logstash\
**Created:** [July 20, 2017, 3:14pm UTC](https://discuss.elastic.co/t/multiple-if-conditions-in-output-section-logstash-conf/93972 "2017-07-20T15:14:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SandhyaRani](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@SandhyaRani](https://discuss.elastic.co/u/SandhyaRani)\
**Post date:** [July 20, 2017, 3:14pm UTC](https://discuss.elastic.co/t/multiple-if-conditions-in-output-section-logstash-conf/93972/1 "2017-07-20T15:14:01Z")

</div>

Hi there!

# I wanted to use if conditionals, Like I dont want to load the log data with log levels TRACE, DEBUG log levels. So here is my output section:

output {  
if "\_grokparsefailure" in [tags] {  
stdout { codec =\> rubydebug }  
}  
if "log" in [tags] {  
if "DEBUG' not in [level]{  
elasticsearch { hosts =\> ["[xxx.xxxx.xxx.com](http://xxx.xxxx.xxx.com)"] }

}  
if "TRACE' not in [level]{  
elasticsearch { hosts =\> ["[xxx.xxxx.xxx.com](http://xxx.xxxx.xxx.com)"] }

}  
}

}

Its working fine. But I wanna use only one condition (like if not in debug OR not in level) then load the log data. I am not able to figure out how to use OR ,(||) here?  
Any help?

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 17, 2017, 3:14pm UTC](https://discuss.elastic.co/t/multiple-if-conditions-in-output-section-logstash-conf/93972/2 "2017-08-17T15:14:14Z")

</div>

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