# Duplicate IDs across rollover indices

**URL:** https://discuss.elastic.co/t/duplicate-ids-across-rollover-indices/196388
**Category:** Elasticsearch
**Created:** [August 22, 2019, 6:40pm UTC](https://discuss.elastic.co/t/duplicate-ids-across-rollover-indices/196388 "2019-08-22T18:40:43Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)
#### Post date: [August 22, 2019, 6:40pm UTC](https://discuss.elastic.co/t/duplicate-ids-across-rollover-indices/196388/1 "2019-08-22T18:40:43Z")

</div>

I am ingesting data into a rollover index. The data comes from an API and gives updates on previously ingested events. Each event has a field that is unique and I am using this as the document ID. However, I've come across an issue recently where I have the same event listed multiple times with each of them existing in separate indices. Below is an example where there are three events when it should only be one. I am ingesting the data using Logstash. Why is this happening?

1st Event  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/1/5182e2fdf3bfde2030c875e8eecb9da6e32f28b0.png)

2nd Event  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/7/87678d0d18e33bb73bf833bfdf3c9f390c29b1fe.png)

3rd Event  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/2/c24015d34c8f7683d4f2fb527cbf5d36238627e8.png)

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [August 23, 2019, 7:18am UTC](https://discuss.elastic.co/t/duplicate-ids-across-rollover-indices/196388/2 "2019-08-23T07:18:16Z")

</div>

if your events are being updating, using rollover is tricky, as you need to figure out which index an event is in before doing the update.

What was the reason for using rollover in this setup? Maybe you can explain a bit more of your rationale here.

---

<div class="post-metadata">

### Author: ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)
#### Post date: [August 23, 2019, 3:36pm UTC](https://discuss.elastic.co/t/duplicate-ids-across-rollover-indices/196388/3 "2019-08-23T15:36:48Z")

</div>

We have an undersized environment that we can't right size so I was trying to conserve resources and improve performance by moving from daily indices that were sometimes only a few MB to rollover based on size.

Some investigation shows that I was sorely mistaken. I assumed fingerprinting would prevent duplication but I just checked an index that ingests millions of events a day with some overlapping events and found duplicates there as well. Looks like I broke the integrity of my data 😠

---

<div class="post-metadata">

### Author: ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)
#### Post date: [August 23, 2019, 4:01pm UTC](https://discuss.elastic.co/t/duplicate-ids-across-rollover-indices/196388/4 "2019-08-23T16:01:38Z")

</div>

> [@spinscale](#):
>
> if your events are being updating, using rollover is tricky, as you need to figure out which index an event is in before doing the update.
> 
> What was the reason for using rollover in this setup? Maybe you can explain a bit more of your rationale here.

Is there a process that needs to be implemented to perform the check, does it need to happen on the data delivery side or on the Elasticsearch side?

The data is being delivered by Logstash so is it gonna be something like querying Elasticsearch for a matching event? Though if that's the case, I'm not 100% sure on how I would do that....i'm thinking pull the previously ingested event's index and use that as the index in my elasticsearch output...but that's probably a question for another forum.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [August 26, 2019, 8:40am UTC](https://discuss.elastic.co/t/duplicate-ids-across-rollover-indices/196388/5 "2019-08-26T08:40:11Z")

</div>

so you have time based data, that needs to be updateable. In that case you need to find out where your data is on the client side of things.

You may want to take a look at the [elasticsearch filter plugin for logstash](https://www.elastic.co/guide/en/logstash/7.3/plugins-filters-elasticsearch.html), but this will have quite an impact on your processing speed I'd assume.

---

<div class="post-metadata">

### Author: ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)
#### Post date: [August 26, 2019, 2:18pm UTC](https://discuss.elastic.co/t/duplicate-ids-across-rollover-indices/196388/6 "2019-08-26T14:18:15Z")

</div>

I actually already opened a post in the Logstash forum regarding this...haven't had much info come from it so far. [Configuring Pipeline To Handle Duplicates In Rollover Indices](https://discuss.elastic.co/t/configuring-pipeline-to-handle-duplicates-in-rollover-indices/196563/3)

---

<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: [September 23, 2019, 2:25pm UTC](https://discuss.elastic.co/t/duplicate-ids-across-rollover-indices/196388/7 "2019-09-23T14:25:20Z")

</div>

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