# Logstash pipeline output | duplicate messages ending up indexes

**URL:** https://discuss.elastic.co/t/logstash-pipeline-output-duplicate-messages-ending-up-indexes/199878
**Category:** Logstash
**Created:** [September 17, 2019, 7:37pm UTC](https://discuss.elastic.co/t/logstash-pipeline-output-duplicate-messages-ending-up-indexes/199878 "2019-09-17T19:37:30Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [September 17, 2019, 11:13pm UTC](https://discuss.elastic.co/t/logstash-pipeline-output-duplicate-messages-ending-up-indexes/199878/4 "2019-09-17T23:13:51Z")

</div>

If the two configurations are completely separate from input to output I would strongly suggest using [multiple pipelines](https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html). If there is overlap, or you are stuck on an old version then you can use something like

```
add_field => { inputTopic => "events" }

```

(with two different value for inputTopic) on the inputs to distinguish them, then use

```
output {
    if [inputTopic] == "events" {
        elasticsearch {
             ...
        }
    }
}

```

to send them to different end-points.

Even better, since you are using a kafka input, you can have the input decorate the [metadata](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-kafka.html#_metadata_fields) with the topic name and then make the output configuration conditional upon that.

---

_[View the full topic](https://discuss.elastic.co/t/logstash-pipeline-output-duplicate-messages-ending-up-indexes/199878)._
