# How to handle log duplications on docker restart

**URL:** https://discuss.elastic.co/t/how-to-handle-log-duplications-on-docker-restart/123183
**Category:** Beats
**Created:** [March 9, 2018, 3:59am UTC](https://discuss.elastic.co/t/how-to-handle-log-duplications-on-docker-restart/123183 "2018-03-09T03:59:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![idangozlan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idangozlan/32/28129_2.png) [@idangozlan](https://discuss.elastic.co/u/idangozlan)
#### Post date: [March 9, 2018, 3:59am UTC](https://discuss.elastic.co/t/how-to-handle-log-duplications-on-docker-restart/123183/1 "2018-03-09T03:59:36Z")

</div>

Hi,

Im trying to understand how to handle cases that filebeat docker is restarted and start collect same logs line again.

I guess that there is a way to mount filebeat offset information, I didn't see any information about that, maybe im searching the wrong keywords.

Edit: is that right thing to do to mount filebeat/data:/usr/share/filebeat/data in order to prevent duplicates?

Thanks

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [March 12, 2018, 10:22am UTC](https://discuss.elastic.co/t/how-to-handle-log-duplications-on-docker-restart/123183/2 "2018-03-12T10:22:31Z")

</div>

Yes, the data directory stores the registry file which has all the information about which files were already read. You should make sure that this is persisted and reused.

---

<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: [April 9, 2018, 12:22pm UTC](https://discuss.elastic.co/t/how-to-handle-log-duplications-on-docker-restart/123183/3 "2018-04-09T12:22:36Z")

</div>

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