# Two difference group\_id get a same consumer of kafka

**URL:** <https://discuss.elastic.co/t/two-difference-group-id-get-a-same-consumer-of-kafka/58121>\
**Category:** Logstash\
**Created:** [August 16, 2016, 10:18am UTC](https://discuss.elastic.co/t/two-difference-group-id-get-a-same-consumer-of-kafka/58121 "2016-08-16T10:18:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![da\_Teng](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@da\_Teng](https://discuss.elastic.co/u/da_Teng)\
**Post date:** [August 16, 2016, 10:18am UTC](https://discuss.elastic.co/t/two-difference-group-id-get-a-same-consumer-of-kafka/58121/1 "2016-08-16T10:18:07Z")

</div>

I use two logstash server with two difference group\_id in input.kafka to get log data from kafka-input and ,but they become a same consumer and average the log data.  
What the error I am not discover?

This is logstash-1(5.0.0) configuration:

> ```
> input {
> kafka {
> bootstrap_servers => "host1:9092,host2:9092,host3:9092"
> group_id => "newlog"
> topics => ["online"]
> client_id => "newlog"
> auto_offset_reset => earliest
> consumer_threads => 3
> }
> }
> 
> ```

This is logstash-2(1.5.4) configuration:

> ```
> input {
> kafka {
> zk_connect => "cstr-01:2181,cstr-02:2181,cstr-03:2181"
> group_id => "logstash"
> topic_id => "online"
> reset_beginning => false
> consumer_threads => 3
> queue_size => 50000
> rebalance_max_retries => 4
> }
> }
> 
> ```

Best regards!

---

<div class="post-metadata">

**Author:** ![Joe\_Lawson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_lawson/32/3390_2.png) [@Joe\_Lawson](https://discuss.elastic.co/u/Joe_Lawson)\
**Post date:** [August 16, 2016, 1:15pm UTC](https://discuss.elastic.co/t/two-difference-group-id-get-a-same-consumer-of-kafka/58121/2 "2016-08-16T13:15:14Z")

</div>

If you consume the same topic with different consumer group ids you should get duplicate data.

---

<div class="post-metadata">

**Author:** ![Joe\_Lawson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_lawson/32/3390_2.png) [@Joe\_Lawson](https://discuss.elastic.co/u/Joe_Lawson)\
**Post date:** [August 16, 2016, 1:16pm UTC](https://discuss.elastic.co/t/two-difference-group-id-get-a-same-consumer-of-kafka/58121/3 "2016-08-16T13:16:40Z")

</div>

I would also check the offsets of the consumer groups with kafka and the thread owners. I think they would be different.

---

<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:** [July 6, 2017, 4:43am UTC](https://discuss.elastic.co/t/two-difference-group-id-get-a-same-consumer-of-kafka/58121/4 "2017-07-06T04:43:20Z")

</div>


