# Separated conf file duplicates search

**URL:** <https://discuss.elastic.co/t/separated-conf-file-duplicates-search/206468>\
**Category:** Logstash\
**Created:** [November 4, 2019, 7:38pm UTC](https://discuss.elastic.co/t/separated-conf-file-duplicates-search/206468 "2019-11-04T19:38:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sud0](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sud0](https://discuss.elastic.co/u/sud0)\
**Post date:** [November 4, 2019, 7:38pm UTC](https://discuss.elastic.co/t/separated-conf-file-duplicates-search/206468/1 "2019-11-04T19:38:04Z")

</div>

Hi.

I've created two conf files under `/etc/logstash/conf.d`. Because I have two businesses in two different countries, I want them to be displayed in two separately indexes.

- Index name `nz-*`
- Index name `au-*`

However, in Kibana when discovering the data, even if I select only index `nz-*`, I can still see data from the other one.

 ![Screenshot%20from%202019-11-05%2008-31-33](https://us1.discourse-cdn.com/elastic/original/3X/d/3/d33fd4d1a5ec3b013372e41d7482c9028eec211a.png)

What am I doing wrong?

business1.conf:

```
output {
    elasticsearch {
        hosts => ["localhost:9200"]
        # Weekly index (for pruning)
        index => "au-log-index-%{+YYYY.'w'ww}"
    }
    stdout { codec => rubydebug }
}

```

business2.conf:

```
output {
    elasticsearch {
        hosts => ["localhost:9200"]
        # Weekly index (for pruning)
        index => "nz-log-index-%{+YYYY.'w'ww}"
    }
    stdout { codec => rubydebug }
}
```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 4, 2019, 7:43pm UTC](https://discuss.elastic.co/t/separated-conf-file-duplicates-search/206468/2 "2019-11-04T19:43:47Z")

</div>

If both configurations are running in the same pipeline then every event will get written to both elasticsearch outputs. You need to either run each business in its own [pipeline](https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html) or use [conditionals](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#conditionals) in your processing.

---

<div class="post-metadata">

**Author:** ![sud0](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sud0](https://discuss.elastic.co/u/sud0)\
**Post date:** [November 4, 2019, 7:47pm UTC](https://discuss.elastic.co/t/separated-conf-file-duplicates-search/206468/3 "2019-11-04T19:47:30Z")

</div>

That's interesting. Thanks for the help! I'll have a read about pipelines for sure! Will mark this question as solved.

---

<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:** [December 2, 2019, 7:47pm UTC](https://discuss.elastic.co/t/separated-conf-file-duplicates-search/206468/4 "2019-12-02T19:47:40Z")

</div>

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