# Watcher rule query on the same row data

**URL:** <https://discuss.elastic.co/t/watcher-rule-query-on-the-same-row-data/277463>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [June 30, 2021, 1:04pm UTC](https://discuss.elastic.co/t/watcher-rule-query-on-the-same-row-data/277463 "2021-06-30T13:04:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manikandanid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manikandanid/32/91013_2.png) [@manikandanid](https://discuss.elastic.co/u/manikandanid)\
**Post date:** [June 30, 2021, 1:04pm UTC](https://discuss.elastic.co/t/watcher-rule-query-on-the-same-row-data/277463/1 "2021-06-30T13:04:50Z")

</div>

I have a use case where i fetch set of records from elastic search in my Webhook watcher rule. The retrieved records contains two column (say x & y), In the watcher rule body i would like to loop the data and include only those data where the value x is greater than y and post only those data to the webhook.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 1, 2021, 2:06pm UTC](https://discuss.elastic.co/t/watcher-rule-query-on-the-same-row-data/277463/2 "2021-07-01T14:06:53Z")

</div>

You can do that with a transform in the action. See [Payload transforms | Elasticsearch Guide [7.13] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/transform.html)

---

<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 29, 2021, 2:07pm UTC](https://discuss.elastic.co/t/watcher-rule-query-on-the-same-row-data/277463/3 "2021-07-29T14:07:29Z")

</div>

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