# Compare a collection/array of 2 numeric field values within same document

**URL:** <https://discuss.elastic.co/t/compare-a-collection-array-of-2-numeric-field-values-within-same-document/277461>\
**Category:** Logstash\
**Created:** [June 30, 2021, 12:52pm UTC](https://discuss.elastic.co/t/compare-a-collection-array-of-2-numeric-field-values-within-same-document/277461 "2021-06-30T12:52:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Munazza](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@Munazza](https://discuss.elastic.co/u/Munazza)\
**Post date:** [June 30, 2021, 12:52pm UTC](https://discuss.elastic.co/t/compare-a-collection-array-of-2-numeric-field-values-within-same-document/277461/1 "2021-06-30T12:52:58Z")

</div>

I am trying to load sql server data to elasticsearch using logstash and have the watcher rule to alert if one field value is greater than the other field value within the same document.

I am looking for a condition in watcher rule to compare a collection/array of 2 numeric field values within same document

---

<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:** [July 28, 2021, 12:53pm UTC](https://discuss.elastic.co/t/compare-a-collection-array-of-2-numeric-field-values-within-same-document/277461/2 "2021-07-28T12:53:41Z")

</div>

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