# Kibana: rule compares difference of two aggregations

**URL:** https://discuss.elastic.co/t/kibana-rule-compares-difference-of-two-aggregations/305393
**Category:** Kibana
**Tags:** elastic-stack-alerting
**Created:** [May 23, 2022, 11:34am UTC](https://discuss.elastic.co/t/kibana-rule-compares-difference-of-two-aggregations/305393 "2022-05-23T11:34:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Johannnnnn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johannnnnn/32/106031_2.png) [@Johannnnnn](https://discuss.elastic.co/u/Johannnnnn)
#### Post date: [May 23, 2022, 11:34am UTC](https://discuss.elastic.co/t/kibana-rule-compares-difference-of-two-aggregations/305393/1 "2022-05-23T11:34:29Z")

</div>

I got two aggregations, both calculating the run time of a test suite differentiating on the specific release. So the results are two long numbers (nanoseconds).

I want to create an alert to send me an e-mail when the difference between the newest and older time is over 10 percent. Does it just take an elaborate KQL or should I look elsewhere?

---

<div class="post-metadata">

### Author: ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)
#### Post date: [May 31, 2022, 4:44pm UTC](https://discuss.elastic.co/t/kibana-rule-compares-difference-of-two-aggregations/305393/2 "2022-05-31T16:44:08Z")

</div>

Looks like a job for [Watcher](https://www.elastic.co/guide/en/kibana/current/watcher-ui.html#watcher-create-advanced-watch)

---

<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: [June 28, 2022, 4:44pm UTC](https://discuss.elastic.co/t/kibana-rule-compares-difference-of-two-aggregations/305393/3 "2022-06-28T16:44:53Z")

</div>

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