# Detect data inconsistency with Elasticsearch

**URL:** <https://discuss.elastic.co/t/detect-data-inconsistency-with-elasticsearch/158321>\
**Category:** Elasticsearch\
**Created:** [November 27, 2018, 10:49am UTC](https://discuss.elastic.co/t/detect-data-inconsistency-with-elasticsearch/158321 "2018-11-27T10:49:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cy\_lir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cy_lir/32/37373_2.png) [@cy\_lir](https://discuss.elastic.co/u/cy_lir)\
**Post date:** [November 27, 2018, 10:49am UTC](https://discuss.elastic.co/t/detect-data-inconsistency-with-elasticsearch/158321/1 "2018-11-27T10:49:33Z")

</div>

Hi !

For a specific application, we generate data (JSON documents) on 3 different servers.  
Those data _should_ be consistent accross all 3 servers, meaning that each server should have the same documents, with the same values by ID, etc

However, it happens that sometimes, the application get unsynced and we can find on a server missing documents, or unpushed modifications (For the same field, values are differents on a document specified by its ID on all servers).

How could I use Elasticsearch to determine which documents are either missing on a server, or inconsistent accross all servers ?

The first thought I had was to hash all documents, and index them on ES by their hash. Therefore, I only have to do a research on the \_version field to find the documents not on version 3, meaning that they either have a different hash (unsynced) or missing on a server (indexed and updated only once).

Would that work ? Is there another cleverer way do to that, maybe using 3 indices ?

Thanks for your help !

Regards,

---

<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:** [December 25, 2018, 10:49am UTC](https://discuss.elastic.co/t/detect-data-inconsistency-with-elasticsearch/158321/2 "2018-12-25T10:49:39Z")

</div>

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