# How to compare two fields of two or more documents

**URL:** <https://discuss.elastic.co/t/how-to-compare-two-fields-of-two-or-more-documents/269190>\
**Category:** Kibana\
**Created:** [April 4, 2021, 4:02pm UTC](https://discuss.elastic.co/t/how-to-compare-two-fields-of-two-or-more-documents/269190 "2021-04-04T16:02:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dinesh\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dinesh_sharma/32/86511_2.png) [@Dinesh\_Sharma](https://discuss.elastic.co/u/Dinesh_Sharma)\
**Post date:** [April 4, 2021, 4:02pm UTC](https://discuss.elastic.co/t/how-to-compare-two-fields-of-two-or-more-documents/269190/1 "2021-04-04T16:02:31Z")

</div>

Hi,

I have 500 documents and half of them contains "IP.keyword" and half contains "Pim\_IP".keyword. Now I want to filter to get all the document which will have Pim\_IP(from one docuement) == IP.keyword( from other document). How to achieve this please help.

---

<div class="post-metadata">

**Author:** ![Dinesh\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dinesh_sharma/32/86511_2.png) [@Dinesh\_Sharma](https://discuss.elastic.co/u/Dinesh_Sharma)\
**Post date:** [April 5, 2021, 7:42am UTC](https://discuss.elastic.co/t/how-to-compare-two-fields-of-two-or-more-documents/269190/2 "2021-04-05T07:42:42Z")

</div>

Hi,  
Any assistance on this will help me a lot.

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [April 5, 2021, 2:21pm UTC](https://discuss.elastic.co/t/how-to-compare-two-fields-of-two-or-more-documents/269190/3 "2021-04-05T14:21:54Z")

</div>

You can't do this in Kibana, because it would require two sequential requests to construct this type of query. Kibana only uses parallel requests.

Because you can do this with two sequential requests, you can automate it using some kind of tool that is external to ES and Kibana, and then send the results back to Elasticsearch to visualize in Kibana.

edit: we are tracking requests like this for multi-step requests in Kibana, and will use this feedback as an example of one of the things that users are asking for while prioritizing work.

---

<div class="post-metadata">

**Author:** ![Dinesh\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dinesh_sharma/32/86511_2.png) [@Dinesh\_Sharma](https://discuss.elastic.co/u/Dinesh_Sharma)\
**Post date:** [April 5, 2021, 5:53pm UTC](https://discuss.elastic.co/t/how-to-compare-two-fields-of-two-or-more-documents/269190/4 "2021-04-05T17:53:07Z")

</div>

Hi,

Yeah please If this kind of functionality can be added in kibana then It would be really great for the users.

---

<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:** [May 3, 2021, 5:53pm UTC](https://discuss.elastic.co/t/how-to-compare-two-fields-of-two-or-more-documents/269190/5 "2021-05-03T17:53:48Z")

</div>

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