# Compare two same filed value from two different indexes

**URL:** <https://discuss.elastic.co/t/compare-two-same-filed-value-from-two-different-indexes/215910>\
**Category:** Elasticsearch\
**Created:** [January 21, 2020, 3:52pm UTC](https://discuss.elastic.co/t/compare-two-same-filed-value-from-two-different-indexes/215910 "2020-01-21T15:52:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elkparser](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@elkparser](https://discuss.elastic.co/u/elkparser)\
**Post date:** [January 21, 2020, 3:52pm UTC](https://discuss.elastic.co/t/compare-two-same-filed-value-from-two-different-indexes/215910/1 "2020-01-21T15:52:32Z")

</div>

Hi,

I have a data like this:

index1: sample\_2020\_01\_21 in this index i have data:

{  
"jobName":"ABC"  
"jobduration": 20  
}

index1: sample\_2020\_01\_20 in this index i have data:

{  
"jobName":"ABC"  
"jobduration": 40  
}

Like that I have daily indexes with some amount of documents, form that indexes I need to query the data based on jobduration to check current day job running is more time on not.  
if that current jobs are running more time then we need to index those documents into other index.

Actually it can possible by using watcher with chain input format, but problem here is no watcher for us, i need plain query language to get this output.

Can you please help me

---

<div class="post-metadata">

**Author:** ![grumo35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grumo35/32/59451_2.png) [@grumo35](https://discuss.elastic.co/u/grumo35)\
**Post date:** [January 21, 2020, 3:57pm UTC](https://discuss.elastic.co/t/compare-two-same-filed-value-from-two-different-indexes/215910/2 "2020-01-21T15:57:56Z")

</div>

Hi,

You should try to use index aliases, [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html)

---

<div class="post-metadata">

**Author:** ![elkparser](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@elkparser](https://discuss.elastic.co/u/elkparser)\
**Post date:** [January 21, 2020, 4:10pm UTC](https://discuss.elastic.co/t/compare-two-same-filed-value-from-two-different-indexes/215910/3 "2020-01-21T16:10:55Z")

</div>

Hi Grumo35,

Thanks for sharing this, Can you share the to compare same filed from two indexes.

If possible please share highly appreciated

---

<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:** [February 18, 2020, 4:11pm UTC](https://discuss.elastic.co/t/compare-two-same-filed-value-from-two-different-indexes/215910/4 "2020-02-18T16:11:03Z")

</div>

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