# Need curl/kibana command which returns "same ids" which are present in 2 different indexes

**URL:** <https://discuss.elastic.co/t/need-curl-kibana-command-which-returns-same-ids-which-are-present-in-2-different-indexes/272529>\
**Category:** Kibana\
**Created:** [May 10, 2021, 4:14am UTC](https://discuss.elastic.co/t/need-curl-kibana-command-which-returns-same-ids-which-are-present-in-2-different-indexes/272529 "2021-05-10T04:14:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rinku\_Gulia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rinku_gulia/32/83691_2.png) [@Rinku\_Gulia](https://discuss.elastic.co/u/Rinku_Gulia)\
**Post date:** [May 10, 2021, 4:14am UTC](https://discuss.elastic.co/t/need-curl-kibana-command-which-returns-same-ids-which-are-present-in-2-different-indexes/272529/1 "2021-05-10T04:14:33Z")

</div>

We have a requirement where we are generating 2 indexes one is open index ,another is closed index. we want to know if same data/id exists in both of them( we are inserting bulk data through one job and at the same time another process also inserts as well).  
In our scenario, we move doc from open to closed when a ticket is closed by agent.  
Therefore at the same time data dumping happens through bulk operation and agents also do their work by closing the ticket. So it may happens that same id ticket generates at 2 different indexes.  
We want to have a query that helps us to know the same ids(doc) which are present in 2 different indexes.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 10, 2021, 4:21am UTC](https://discuss.elastic.co/t/need-curl-kibana-command-which-returns-same-ids-which-are-present-in-2-different-indexes/272529/2 "2021-05-10T04:21:13Z")

</div>

Please edit your post and remove the formatting on the plain text, it's very difficult to read as it is.

---

<div class="post-metadata">

**Author:** ![Rinku\_Gulia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rinku_gulia/32/83691_2.png) [@Rinku\_Gulia](https://discuss.elastic.co/u/Rinku_Gulia)\
**Post date:** [May 10, 2021, 6:13am UTC](https://discuss.elastic.co/t/need-curl-kibana-command-which-returns-same-ids-which-are-present-in-2-different-indexes/272529/3 "2021-05-10T06:13:42Z")

</div>

@warkolm could you help now?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 10, 2021, 6:16am UTC](https://discuss.elastic.co/t/need-curl-kibana-command-which-returns-same-ids-which-are-present-in-2-different-indexes/272529/4 "2021-05-10T06:16:28Z")

</div>

Thank you!

So to summarise what you want - you want to be able to run a single query that will show any document IDs that are in both indices?

---

<div class="post-metadata">

**Author:** ![Rinku\_Gulia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rinku_gulia/32/83691_2.png) [@Rinku\_Gulia](https://discuss.elastic.co/u/Rinku_Gulia)\
**Post date:** [May 10, 2021, 6:17am UTC](https://discuss.elastic.co/t/need-curl-kibana-command-which-returns-same-ids-which-are-present-in-2-different-indexes/272529/5 "2021-05-10T06:17:21Z")

</div>

@warkolm Right.

---

<div class="post-metadata">

**Author:** ![Rinku\_Gulia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rinku_gulia/32/83691_2.png) [@Rinku\_Gulia](https://discuss.elastic.co/u/Rinku_Gulia)\
**Post date:** [May 11, 2021, 4:43am UTC](https://discuss.elastic.co/t/need-curl-kibana-command-which-returns-same-ids-which-are-present-in-2-different-indexes/272529/6 "2021-05-11T04:43:58Z")

</div>

@warkolm Please update on this.  
my indexes pattern :  
interaction-open\_read\_model\_1  
interaction-closed\_read\_model\_1-2021.03.02-00001

interaction-open\_read\_model\_2  
interaction-closed\_read\_model\_2-2021.03.02-00001

---

<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:** [June 8, 2021, 4:44am UTC](https://discuss.elastic.co/t/need-curl-kibana-command-which-returns-same-ids-which-are-present-in-2-different-indexes/272529/7 "2021-06-08T04:44:43Z")

</div>

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