# Logstash Read and Write from 2 Different Kafka

**URL:** https://discuss.elastic.co/t/logstash-read-and-write-from-2-different-kafka/301731
**Category:** Logstash
**Created:** [April 6, 2022, 9:43am UTC](https://discuss.elastic.co/t/logstash-read-and-write-from-2-different-kafka/301731 "2022-04-06T09:43:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![osy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/osy/32/99542_2.png) [@osy](https://discuss.elastic.co/u/osy)
#### Post date: [April 6, 2022, 9:43am UTC](https://discuss.elastic.co/t/logstash-read-and-write-from-2-different-kafka/301731/1 "2022-04-06T09:43:36Z")

</div>

1. Can logstash read from 2 different kafka which has same topic&tag name?
2. Can logstash write these 2 kafka logs to same Elasticsearch?

Example:

```auto
input {

kafka {
codec => “json”
bootstrap_servers => “172.16.1.15:9092”
topics => [“APP1_logs”]
tags => [“app1logs”]
}

kafka {
codec => “json”
bootstrap_servers => “172.16.1.25:9092”
topics => [“APP1_logs”]
tags => [“app1logs”]
}

}

output {

if “app1logs” in [tags] {
elasticsearch {
hosts => [“localhost:9200”]
index => “app1logs”
}
stdout {codec => rubydebug}
}

}

```

---

<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 4, 2022, 9:44am UTC](https://discuss.elastic.co/t/logstash-read-and-write-from-2-different-kafka/301731/2 "2022-05-04T09:44:22Z")

</div>

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