# Output to both Kafka and Elasticsearch

**URL:** <https://discuss.elastic.co/t/output-to-both-kafka-and-elasticsearch/231691>\
**Category:** Logstash\
**Created:** [May 8, 2020, 9:26am UTC](https://discuss.elastic.co/t/output-to-both-kafka-and-elasticsearch/231691 "2020-05-08T09:26:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![omersiar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/omersiar/32/70536_2.png) [@omersiar](https://discuss.elastic.co/u/omersiar)\
**Post date:** [May 8, 2020, 9:26am UTC](https://discuss.elastic.co/t/output-to-both-kafka-and-elasticsearch/231691/1 "2020-05-08T09:26:59Z")

</div>

Hello All,

I would like to know that if Logstash is capable of outputting the filtered data to both Kafka and Elasticsearch, see example below:

```auto
    input {
    }

    filter {
      # dissect scope
      dissect {
        # do dissecting
      }
    }

    output {
      elasticsearch {
                hosts => ["localhost:9200"]
      }
      kafka {
          codec => json
          topic_id => "mytopic"
      }
    }

```

Is it going to work?

---

<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:** [May 8, 2020, 12:40pm UTC](https://discuss.elastic.co/t/output-to-both-kafka-and-elasticsearch/231691/2 "2020-05-08T12:40:40Z")

</div>

> [@omersiar](#):
>
> I would like to know that if Logstash is capable of outputting the filtered data to both Kafka and Elasticsearch

Yes, you can output events to multiple destinations.

---

<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:** [June 5, 2020, 12:40pm UTC](https://discuss.elastic.co/t/output-to-both-kafka-and-elasticsearch/231691/3 "2020-06-05T12:40:42Z")

</div>

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