# How to create if conditional statement in logstash config.yml file

**URL:** https://discuss.elastic.co/t/how-to-create-if-conditional-statement-in-logstash-config-yml-file/153134
**Category:** Logstash
**Created:** [October 19, 2018, 7:57am UTC](https://discuss.elastic.co/t/how-to-create-if-conditional-statement-in-logstash-config-yml-file/153134 "2018-10-19T07:57:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Nethaji](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nethaji/32/72803_2.png) [@Nethaji](https://discuss.elastic.co/u/Nethaji)
#### Post date: [October 19, 2018, 7:57am UTC](https://discuss.elastic.co/t/how-to-create-if-conditional-statement-in-logstash-config-yml-file/153134/1 "2018-10-19T07:57:10Z")

</div>

Eg:

if id =1 means i need to change this into "compliance"  
can u please explain how to do this?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [October 19, 2018, 8:04am UTC](https://discuss.elastic.co/t/how-to-create-if-conditional-statement-in-logstash-config-yml-file/153134/2 "2018-10-19T08:04:20Z")

</div>

Please explain what you are trying to achieve and what your current configuration looks like. It is not clear what you are looking for so I doubt anyone will be able to help you just based on this information. The more effort you put into properly crafting a question, the better your responses are likely to be.

---

<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: [November 16, 2018, 8:04am UTC](https://discuss.elastic.co/t/how-to-create-if-conditional-statement-in-logstash-config-yml-file/153134/3 "2018-11-16T08:04:26Z")

</div>

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