# Compare three different fields from two different indices in a watcher

**URL:** <https://discuss.elastic.co/t/compare-three-different-fields-from-two-different-indices-in-a-watcher/216528>\
**Category:** Elasticsearch\
**Created:** [January 25, 2020, 3:20pm UTC](https://discuss.elastic.co/t/compare-three-different-fields-from-two-different-indices-in-a-watcher/216528 "2020-01-25T15:20:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierrejutard](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@pierrejutard](https://discuss.elastic.co/u/pierrejutard)\
**Post date:** [January 25, 2020, 3:20pm UTC](https://discuss.elastic.co/t/compare-three-different-fields-from-two-different-indices-in-a-watcher/216528/1 "2020-01-25T15:20:20Z")

</div>

Hello,

I have two indice on elastic search and i would like to compare it on a watcher.

I have from one index the spot field :  
"hits" : [  
{  
"\_index" : "mktdata-2020.01.25",  
"\_type" : "\_doc",  
"\_id" : "Ue883W8BBSmqUyPKwncF",  
"\_score" : 1.0,  
"\_source" : {  
"oned" : 3.0,  
"twod" : 5.0,  
"@timestamp" : "2020-01-25T15:05:43.690Z",  
"spot" : 1.0  
}  
}  
]  
and i have from another index the lbound and ubound:

```
"hits" : [
  {
    "_index" : "price-request-2020.01.25",
    "_type" : "email",
    "_id" : "Uu8-3W8BBSmqUyPKQnfN",
    "_score" : 1.0,
    "_source" : {
      "subject" : "price request",
      "lbound" : "0",
      "@timestamp" : "2020-01-25T15:07:09.000Z",
      "ubound" : "2"
    }
  }
]

```

I want to check if the spot field value is between the lbound and ubound fields value in a watcher during the time i am running my multiplepipelines with logstash:  
Does anyone know how to make it?

Thank you in advance  
Pierre Jutard

---

<div class="post-metadata">

**Author:** ![pierrejutard](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@pierrejutard](https://discuss.elastic.co/u/pierrejutard)\
**Post date:** [January 28, 2020, 9:47pm UTC](https://discuss.elastic.co/t/compare-three-different-fields-from-two-different-indices-in-a-watcher/216528/2 "2020-01-28T21:47:40Z")

</div>

Final solution:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/0/a0977cb1f75da0cb3d13489fcde7a9ce6b8607d6.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/6/f61356a6a189ca1b5ea7716ef5d2f476e7e01917.png)

![image](https://us1.discourse-cdn.com/elastic/original/3X/c/2/c2b570232444b4917bac14031d84bc28012741c0.png)

Thanks  
Pierre Jutard

---

<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 25, 2020, 9:47pm UTC](https://discuss.elastic.co/t/compare-three-different-fields-from-two-different-indices-in-a-watcher/216528/3 "2020-02-25T21:47:41Z")

</div>

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