# \_id as a consistent hash to avoid duplication with replays

**URL:** <https://discuss.elastic.co/t/-id-as-a-consistent-hash-to-avoid-duplication-with-replays/24411>\
**Category:** Logstash\
**Created:** [June 26, 2015, 10:04am UTC](https://discuss.elastic.co/t/-id-as-a-consistent-hash-to-avoid-duplication-with-replays/24411 "2015-06-26T10:04:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomr/32/48260_2.png) [@tomr](https://discuss.elastic.co/u/tomr)\
**Post date:** [June 26, 2015, 10:04am UTC](https://discuss.elastic.co/t/-id-as-a-consistent-hash-to-avoid-duplication-with-replays/24411/1 "2015-06-26T10:04:07Z")

</div>

Hi All,

I'm trying to create a situation where I have the option of replaying logs with zero risk of duplication. It seems to me that a good way to do that would be to make a field, possibly UUID or \_id, be a consistent has of the input. Data is a slightly modified apache log.

Our environment is such that "at least once" delivery is much much easier than "exactly once". Any pointers on how to achieve this? I'm using log-courier on the edge (the logstash-forwarder fork) forwarding to logstash running locally on single-node ES cluster.

I've seen a few custom approaches to doing this (eg [How to create my own document\_id in logstash?](https://discuss.elastic.co/t/how-to-create-my-own-document-id-in-logstash/1416/9)) but I'm surprised there isn't a Supported Way To Do It - maybe there is and I can't find it?

Thanks in advance,  
Tom

---

<div class="post-metadata">

**Author:** ![tomr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomr/32/48260_2.png) [@tomr](https://discuss.elastic.co/u/tomr)\
**Post date:** [June 26, 2015, 11:10am UTC](https://discuss.elastic.co/t/-id-as-a-consistent-hash-to-avoid-duplication-with-replays/24411/2 "2015-06-26T11:10:30Z")

</div>

solved in [How to create my own document\_id in logstash?](https://discuss.elastic.co/t/how-to-create-my-own-document-id-in-logstash/1416/9)

---

<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, 5:36am UTC](https://discuss.elastic.co/t/-id-as-a-consistent-hash-to-avoid-duplication-with-replays/24411/3 "2017-07-06T05:36:22Z")

</div>


