# Is it possible to use "nested if" in logstash.conf

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-use-nested-if-in-logstash-conf/59655>\
**Category:** Logstash\
**Created:** [September 2, 2016, 11:11am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-nested-if-in-logstash-conf/59655 "2016-09-02T11:11:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)\
**Post date:** [September 2, 2016, 11:11am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-nested-if-in-logstash-conf/59655/1 "2016-09-02T11:11:16Z")

</div>

Hi Team,

Is it possible to use "nested if" in output section inside logstash.conf ?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 2, 2016, 11:33am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-nested-if-in-logstash-conf/59655/2 "2016-09-02T11:33:57Z")

</div>

If you mean

```nohighlight
if ... {
  if ... {
    if ... {
      ...
    }
  }
}

```

then yes.

---

<div class="post-metadata">

**Author:** ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)\
**Post date:** [September 2, 2016, 11:34am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-nested-if-in-logstash-conf/59655/3 "2016-09-02T11:34:48Z")

</div>

Ok. 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:** [July 6, 2017, 4:40am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-nested-if-in-logstash-conf/59655/4 "2017-07-06T04:40:15Z")

</div>


