# ES query to check the existence of a document\_id?

**URL:** https://discuss.elastic.co/t/es-query-to-check-the-existence-of-a-document-id/234854
**Category:** Logstash
**Created:** [May 29, 2020, 4:39am UTC](https://discuss.elastic.co/t/es-query-to-check-the-existence-of-a-document-id/234854 "2020-05-29T04:39:53Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Nani\_20](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@Nani\_20](https://discuss.elastic.co/u/Nani_20)
#### Post date: [May 29, 2020, 8:24am UTC](https://discuss.elastic.co/t/es-query-to-check-the-existence-of-a-document-id/234854/5 "2020-05-29T08:24:28Z")

</div>

Sorry my bad, I have corrected the config file now. I think I had different file copied initially.  
Anyways, I would like to use the **entire message as an ID**. As you suggested, I think it would be ideal to generate **UUID** using **fingerprint filter** and then use it to avoid duplicates. I am I right here?  
But, this will still allow duplicates to enter the other filter plugins right. Is there any way I can avoid/drop these duplicates right after creating the ID by **fingerprint filter** and check its existence in ES instead of waiting till **ES output plugin**. This will save lot of time and effort.

Please refer to this [post](https://discuss.elastic.co/t/how-to-avoid-duplicates-before-entering-the-filter-plugin/234735/3) for your reference

---

_[View the full topic](https://discuss.elastic.co/t/es-query-to-check-the-existence-of-a-document-id/234854)._
