# How to identify whether a elasticsearch document is modified or not?

**URL:** <https://discuss.elastic.co/t/how-to-identify-whether-a-elasticsearch-document-is-modified-or-not/306537>\
**Category:** Logstash\
**Created:** [June 7, 2022, 8:17am UTC](https://discuss.elastic.co/t/how-to-identify-whether-a-elasticsearch-document-is-modified-or-not/306537 "2022-06-07T08:17:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Souvik\_Das](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/souvik_das/32/107606_2.png) [@Souvik\_Das](https://discuss.elastic.co/u/Souvik_Das)\
**Post date:** [June 7, 2022, 8:17am UTC](https://discuss.elastic.co/t/how-to-identify-whether-a-elasticsearch-document-is-modified-or-not/306537/1 "2022-06-07T08:17:31Z")

</div>

Hi All,

If a logstash pipeline (conf file) is used to update and insert both i.e., enabled below in the conf file.

```auto
doc_as_upsert => true
action => "update"

```

How to know which documents are updated and which are inserted?

Please note that I have checked about `_version` field. But it is not helpful in my case as it is not a searchable field.

Please guide!

Regards,  
Souvik

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [June 8, 2022, 8:37am UTC](https://discuss.elastic.co/t/how-to-identify-whether-a-elasticsearch-document-is-modified-or-not/306537/2 "2022-06-08T08:37:38Z")

</div>

I suppose you need some "update\_counter" or "update\_flag" field which is inserted by [some script](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html#upserts).

---

<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, 2022, 8:37am UTC](https://discuss.elastic.co/t/how-to-identify-whether-a-elasticsearch-document-is-modified-or-not/306537/3 "2022-07-06T08:37:43Z")

</div>

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