# How to re fetch data from Kafka, from the beginning of topic, without changing consumer group? (resetting consumer group offset)

**URL:** <https://discuss.elastic.co/t/how-to-re-fetch-data-from-kafka-from-the-beginning-of-topic-without-changing-consumer-group-resetting-consumer-group-offset/84492>\
**Category:** Logstash\
**Created:** [May 4, 2017, 6:33am UTC](https://discuss.elastic.co/t/how-to-re-fetch-data-from-kafka-from-the-beginning-of-topic-without-changing-consumer-group-resetting-consumer-group-offset/84492 "2017-05-04T06:33:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [May 4, 2017, 6:33am UTC](https://discuss.elastic.co/t/how-to-re-fetch-data-from-kafka-from-the-beginning-of-topic-without-changing-consumer-group-resetting-consumer-group-offset/84492/1 "2017-05-04T06:33:13Z")

</div>

Hi,

I am using ELK GA 5.0.0. I have a logstash instance to pull data from a kafka topic, like below;

```
kafka{
	group_id => "kafkagroupA"
	topics => ["kafkatopicA"]
	bootstrap_servers => "192.168.0.1:9091,192.168.0.2:9093,192.168.0.3:9092"
	codec => json
}

```

due to some config errors, my logs of past 2 days hasn't entered elasticsearch, but logstash was consuming. Now, I have corrected the config, and logs are coming fine. How can I get the old logs (past 2 days)? It is there in Kafka topic. I cant change the consumer group (`group_id`). Is there any way to achieve this?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [May 12, 2017, 9:13am UTC](https://discuss.elastic.co/t/how-to-re-fetch-data-from-kafka-from-the-beginning-of-topic-without-changing-consumer-group-resetting-consumer-group-offset/84492/2 "2017-05-12T09:13:56Z")

</div>

The offsets for the Consumer Group are stored in Kafka itself per partition.

You need to use Kafka tools to do this. Here is a link to an article that may help - [https://community.hortonworks.com/articles/81357/manually-resetting-offset-for-a-kafka-topic.html](https://community.hortonworks.com/articles/81357/manually-resetting-offset-for-a-kafka-topic.html)

---

<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 9, 2017, 9:21am UTC](https://discuss.elastic.co/t/how-to-re-fetch-data-from-kafka-from-the-beginning-of-topic-without-changing-consumer-group-resetting-consumer-group-offset/84492/3 "2017-06-09T09:21:35Z")

</div>

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