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

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.

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

@warkolm could you help now?

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?

@warkolm Right.

@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

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