# Duplicate documents after Logstash restart

**URL:** <https://discuss.elastic.co/t/duplicate-documents-after-logstash-restart/102175>\
**Category:** Logstash\
**Created:** [September 28, 2017, 7:44pm UTC](https://discuss.elastic.co/t/duplicate-documents-after-logstash-restart/102175 "2017-09-28T19:44:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Absinthe](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@Absinthe](https://discuss.elastic.co/u/Absinthe)\
**Post date:** [September 28, 2017, 7:44pm UTC](https://discuss.elastic.co/t/duplicate-documents-after-logstash-restart/102175/1 "2017-09-28T19:44:12Z")

</div>

Using Windows7  
Using Logstash 5.4.1

input:  
{  
azurewadtable {  
add\_field =\> { "input\_origin" =\> "MyServerLogs" }  
storage\_account\_name =\> "MyDeploy"  
storage\_sas\_token =\> "xxxxxxxxxx"  
table\_name =\> "WadLogsTable"  
collection\_start\_time\_utc =\> "2017-09-01"  
}  
}  
Each record has a unique document\_id, but after a crash all documents are duplicated

Output:  
elasticsearch {  
hosts =\> ["localhost:9200"]  
document\_id =\> "%{PartitionKey}-%{RowKey}"  
}

I found the following in "Little Logstash Lessons: Handling Duplicates" documentation and gave it a try.

filter  
{  
fingerprint {  
source =\> ["PartitionKey", "RowKey"]  
concatenate\_sources =\> true  
method =\> "MURMUR3"  
}  
}

output  
{  
elasticsearch {  
hosts =\> ["localhost:9200"]  
document\_id =\> "%{fingerprint}"  
}  
}

I now get a unique Id column which I assign to document\_id

However whenever Logstash restarts all document are duplicated.

How can I prevent this from happening?

---

<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:** [October 26, 2017, 7:44pm UTC](https://discuss.elastic.co/t/duplicate-documents-after-logstash-restart/102175/2 "2017-10-26T19:44:16Z")

</div>

Closed on October 26, 2017, 7:44pm UTC

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