# Two outputs with different data

**URL:** <https://discuss.elastic.co/t/two-outputs-with-different-data/128966>\
**Category:** Logstash\
**Created:** [April 21, 2018, 12:35pm UTC](https://discuss.elastic.co/t/two-outputs-with-different-data/128966 "2018-04-21T12:35:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexH](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@AlexH](https://discuss.elastic.co/u/AlexH)\
**Post date:** [April 21, 2018, 12:35pm UTC](https://discuss.elastic.co/t/two-outputs-with-different-data/128966/1 "2018-04-21T12:35:05Z")

</div>

I want to take one input, do some filters, send output to one ES index, do more filters, then send to a second ES index.

The result should be one index with a set of fields, and the second index has a mostly different set of fields but based on the same original input.

In my logstash config, I tried input -\> filter -\> output -\> filter -\> output, where the second filter removes most fields and adds a few new ones before sending it to the second index, but the result is both indexes end up getting the combined filter result.

Any ideas?

---

<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:** [April 21, 2018, 1:35pm UTC](https://discuss.elastic.co/t/two-outputs-with-different-data/128966/2 "2018-04-21T13:35:34Z")

</div>

Events are read from inputs, sent through all the filters, then written to the outputs. So what you are seeing is expected.

You could write the events to a second logstash instance, or a different pipeline if you are using a recent version.

---

<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:** [April 21, 2018, 6:36pm UTC](https://discuss.elastic.co/t/two-outputs-with-different-data/128966/3 "2018-04-21T18:36:20Z")

</div>

You can use the clone filter to create a second event. Add the additional fields only to one of these events and then send them to different outputs.

---

<div class="post-metadata">

**Author:** ![AlexH](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@AlexH](https://discuss.elastic.co/u/AlexH)\
**Post date:** [April 22, 2018, 10:31pm UTC](https://discuss.elastic.co/t/two-outputs-with-different-data/128966/4 "2018-04-22T22:31:22Z")

</div>

That's a great idea. I'll try that and see if I can get it working. 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:** [May 20, 2018, 10:31pm UTC](https://discuss.elastic.co/t/two-outputs-with-different-data/128966/5 "2018-05-20T22:31:25Z")

</div>

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