# Watcher source script problem /Index\_out\_of\_bounds\_exception

**URL:** <https://discuss.elastic.co/t/watcher-source-script-problem-index-out-of-bounds-exception/216909>\
**Category:** Elasticsearch\
**Created:** [January 28, 2020, 8:48pm UTC](https://discuss.elastic.co/t/watcher-source-script-problem-index-out-of-bounds-exception/216909 "2020-01-28T20:48:08Z")\
**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 28, 2020, 8:48pm UTC](https://discuss.elastic.co/t/watcher-source-script-problem-index-out-of-bounds-exception/216909/1 "2020-01-28T20:48:08Z")

</div>

Hello,

I try to make a watcher where one field ("spot") from one indice ("mktdata-2020.01.28") will be compared from two fields ("lbound" and "ubound") from another indice ("price-request-2020.01.28") but i am stuck since a couple of hours on the script and this "index\_out\_of\_bounds\_exception" java error.

I gave some ES snippets if someone can help:  
First:

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

Second:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/4/b467133cce7b4ca8b6c8bbbbc58e933f79bfad5c.png)

My configuration watch:

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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/7/371e047bbed60a1d65cf1de84f765e84e8f33734.png)

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

The result:

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

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

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

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

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

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

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

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

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

Can someone help me on this please?

Thank you,  
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:46pm UTC](https://discuss.elastic.co/t/watcher-source-script-problem-index-out-of-bounds-exception/216909/2 "2020-01-28T21:46:52Z")

</div>

It' s a size problem, when setting Size:10 it worked and i go to a cast error after but when you change the equality in inequality it worked definitly.  
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/watcher-source-script-problem-index-out-of-bounds-exception/216909/3 "2020-02-25T21:47:06Z")

</div>

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