# Will logstash duplicate already indexed data in elasticsearch?

**URL:** <https://discuss.elastic.co/t/will-logstash-duplicate-already-indexed-data-in-elasticsearch/25394>\
**Category:** Logstash\
**Created:** [July 12, 2015, 4:38pm UTC](https://discuss.elastic.co/t/will-logstash-duplicate-already-indexed-data-in-elasticsearch/25394 "2015-07-12T16:38:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhutchinson](https://avatars.discourse-cdn.com/v4/letter/b/2acd7d/32.png) [@bhutchinson](https://discuss.elastic.co/u/bhutchinson)\
**Post date:** [July 12, 2015, 4:38pm UTC](https://discuss.elastic.co/t/will-logstash-duplicate-already-indexed-data-in-elasticsearch/25394/1 "2015-07-12T16:38:47Z")

</div>

**Versions**  
Windows 7  
elasticsearch v1.6.0  
logstash v1.5.2  
kibana v4.1.0

**Background**  
Right now I am just working on a proof of concept locally and am not using a Logstash Forwarder. I am manually running logstash from the DOS Prompt to load data from an Apache Access Log into elasticsearch

**Question**  
Assume that I already have data indexed in elasticsearch. I do not want duplicate documents in elasticsearch. If I use logstash to an Apache Log File, if logstash/elasticsearch determines that the data from the log file already exists in elasticsearch, will the already indexed data in elasticsearch get duplicated or will the already indexed data be deleted and then re-added to elasticsearch (no duplication)?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 12, 2015, 7:31pm UTC](https://discuss.elastic.co/t/will-logstash-duplicate-already-indexed-data-in-elasticsearch/25394/2 "2015-07-12T19:31:47Z")

</div>

Logstash doesn't care what's already in Elasticsearch. The file input does however track how much of a file that has been processed which normally prevents duplication of input data.

---

<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:34am UTC](https://discuss.elastic.co/t/will-logstash-duplicate-already-indexed-data-in-elasticsearch/25394/3 "2017-07-06T05:34:53Z")

</div>


