# Logstash output conditions doesn't works

**URL:** https://discuss.elastic.co/t/logstash-output-conditions-doesnt-works/53779
**Category:** Logstash
**Created:** [June 23, 2016, 12:51pm UTC](https://discuss.elastic.co/t/logstash-output-conditions-doesnt-works/53779 "2016-06-23T12:51:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Clement\_Ros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clement_ros/32/6198_2.png) [@Clement\_Ros](https://discuss.elastic.co/u/Clement_Ros)
#### Post date: [June 23, 2016, 12:51pm UTC](https://discuss.elastic.co/t/logstash-output-conditions-doesnt-works/53779/1 "2016-06-23T12:51:27Z")

</div>

Hi,

My problem is that the conditions in my logstash conf file in the output section, seems to not work.

here is my output section:

```
output {
        if "topbeat" in [tags] {
                if "_grokparsefailure" not in [tags] {
                        elasticsearch {
                                hosts => ["10.1.101.1", "10.1.102.1", "10.1.103.1"]
                                manage_template => false
                                index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
                                document_type => "%{[@metadata][type]}"
                        }
                }
        }
        else if "nginx" in [tags] {
                if "_grokparsefailure" not in [tags] {
                        elasticsearch {
                                hosts => ["10.1.101.1", "10.1.102.1", "10.1.103.1"]
                                index => "logstash-isg-%{+YYYY.MM.dd}"
                        }
                }
        }
        else if "scarlette" in [tags] {
                if "_grokparsefailure" not in [tags] {
                        elasticsearch {
                                hosts => ["10.1.101.1", "10.1.102.1", "10.1.103.1"]
                                manage_template => false
                                index => "logstash-scarlette-%{+YYYY.MM.dd}"
                        }
                }
        }
        else if "serveur_owncloud" in [tags] {
                if "_grokparsefailure" not in [tags] {
                        elasticsearch {
                                hosts => ["10.1.101.1", "10.1.102.1", "10.1.103.1"]
                                index => "logstash-owncloud-%{+YYYY.MM.dd}"
                        }
                }
        }
        else if "brouette" in [tags] or "poussette" in [tags] {
                if "_grokparsefailure" not in [tags] {
                        elasticsearch {
                                hosts => ["10.1.101.1", "10.1.102.1", "10.1.103.1"]
                                manage_template => false
                                index => "logstash-mta-%{+YYYY.MM.dd}"
                        }
                }
        }
        else if "serveur_proxy" in [tags] or "serveur_dns" in [tags] {
                if "_grokparsefailure" not in [tags] {
                        elasticsearch {
                                hosts => ["10.1.101.1", "10.1.102.1", "10.1.103.1"]
                        }

# file {
# path => "/var/log/LS-redis-flux.log"
# }
                }
        }
}

```

To give you an example, i have some "serveur\_proxy" data that goes into the tobeat indexe.

I don't find the solution...

Anyone can help me please

---

<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: [June 29, 2016, 8:07pm UTC](https://discuss.elastic.co/t/logstash-output-conditions-doesnt-works/53779/2 "2016-06-29T20:07:55Z")

</div>

Make sure you don't have any unexpected files in /etc/logstash/conf.d (or wherever your configuration files are stored).

If that doesn't help, please post a minimal configuration that exhibits the problem.

---

<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:50am UTC](https://discuss.elastic.co/t/logstash-output-conditions-doesnt-works/53779/3 "2017-07-06T04:50:20Z")

</div>


