# Kibana alerts: Calculate percentage of errors for a given period time

**URL:** <https://discuss.elastic.co/t/kibana-alerts-calculate-percentage-of-errors-for-a-given-period-time/271133>\
**Category:** Kibana\
**Created:** [April 24, 2021, 7:56am UTC](https://discuss.elastic.co/t/kibana-alerts-calculate-percentage-of-errors-for-a-given-period-time/271133 "2021-04-24T07:56:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Miragi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_miragi/32/87672_2.png) [@Rahul\_Miragi](https://discuss.elastic.co/u/Rahul_Miragi)\
**Post date:** [April 24, 2021, 7:56am UTC](https://discuss.elastic.co/t/kibana-alerts-calculate-percentage-of-errors-for-a-given-period-time/271133/1 "2021-04-24T07:56:10Z")

</div>

I’m looking for a solution to following problem:

In ELK, I have to create an alert which will trigger - when an error field logged for an index is greater than 80% in last 30 mins The field name is status and it takes info and error as values. I need to get the count of these fields for last 15 minutes and calculate percentage of errors based on that

Count of errors/total counts.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 24, 2021, 1:59pm UTC](https://discuss.elastic.co/t/kibana-alerts-calculate-percentage-of-errors-for-a-given-period-time/271133/2 "2021-04-24T13:59:20Z")

</div>

Hi @Rahul_Miragi Welcome to the community.

I believe what you are looking for can be created using a logs threshold alert with a ratio. See [here](https://www.elastic.co/guide/en/observability/7.12/logs-threshold-alert.html#ratio-alerts)

One thing to remember is to configure your log source see [here](https://www.elastic.co/guide/en/observability/7.12/configure-data-sources.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:** [May 22, 2021, 2:00pm UTC](https://discuss.elastic.co/t/kibana-alerts-calculate-percentage-of-errors-for-a-given-period-time/271133/3 "2021-05-22T14:00:13Z")

</div>

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