# How to use the result of two buckets count divison in alerts?

**URL:** https://discuss.elastic.co/t/how-to-use-the-result-of-two-buckets-count-divison-in-alerts/257109
**Category:** Kibana
**Created:** [November 30, 2020, 6:03pm UTC](https://discuss.elastic.co/t/how-to-use-the-result-of-two-buckets-count-divison-in-alerts/257109 "2020-11-30T18:03:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![I\_Hathout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/i_hathout/32/76915_2.png) [@I\_Hathout](https://discuss.elastic.co/u/I_Hathout)
#### Post date: [November 30, 2020, 6:03pm UTC](https://discuss.elastic.co/t/how-to-use-the-result-of-two-buckets-count-divison-in-alerts/257109/1 "2020-11-30T18:03:18Z")

</div>

I 've a filter that contains data from two indices payment\_transfer and payment\_transfer\_failure. I want to set an alert of the number of transfer\_failure\_count in a month/ number of transfers whiten the same month is above a threshold value.

So suppose we have the following data in a filter 'payment\_tr\*':

> March 26th 2019, 01:06:10.841 code:R01 transfer\_id:4,504 @timestamp:November 24th 2020, 02:06:30.616 created:March 26th 2019, 01:06:10.841 @version:1 id:316 \_id:316 \_type:doc \_index:payment-transfer-failure \_score:1.561  
> March 26th 2019, 01:06:46.904 code:R01 transfer\_id:4,328 @timestamp:November 24th 2020, 02:06:30.616 created:March 26th 2019, 01:06:46.904 @version:1 id:327 \_id:327 \_type:doc \_index:payment-transfer-failure \_score:1.561
> 
> March 26th 2019, 01:06:46.904 @timestamp:November 24th 2020, 02:06:30.616 created:March 26th 2019, 01:09:46.904 @version:1 \_id:327 \_type:doc \_index:payment-transfer

I wanna a short way to get the count of payment-transfer-failure in a month divided by \_index:payment-transfer of the same month so in that case 2/1 = 0.5 so that I can set a filter to notify me if the rate exceeded 0.75 for example.

---

<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: [December 28, 2020, 6:03pm UTC](https://discuss.elastic.co/t/how-to-use-the-result-of-two-buckets-count-divison-in-alerts/257109/2 "2020-12-28T18:03:28Z")

</div>

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