# Define Multiple Conditions in an Alert

**URL:** <https://discuss.elastic.co/t/define-multiple-conditions-in-an-alert/322652>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [January 7, 2023, 1:46am UTC](https://discuss.elastic.co/t/define-multiple-conditions-in-an-alert/322652 "2023-01-07T01:46:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlucas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jlucas/32/90984_2.png) [@jlucas](https://discuss.elastic.co/u/jlucas)\
**Post date:** [January 7, 2023, 1:46am UTC](https://discuss.elastic.co/t/define-multiple-conditions-in-an-alert/322652/1 "2023-01-07T01:46:04Z")

</div>

Is it possible to define multiple conditions in an alert? Based on this documentation ([Alerting | Kibana Guide [8.5] | Elastic](https://www.elastic.co/guide/en/kibana/current/alerting-getting-started.html#_rules)) it doesn't appear to. I would like to trigger an alert when 2 conditions are met. I want to query one index in one condition and query another index in the another condition. For example lets say I have one index that receives event logs of when items are processed from a queue. Then I have another index that has metrics of many items are in the queue. I would like to generate an alert if processing\_rate \< 1 for last 5 mins AND queue\_count \> 100 for last 5 mins. Is this possible to do in the UI or in the API?

---

<div class="post-metadata">

**Author:** ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)\
**Post date:** [January 9, 2023, 1:49pm UTC](https://discuss.elastic.co/t/define-multiple-conditions-in-an-alert/322652/2 "2023-01-09T13:49:41Z")

</div>

My only thought is using the [Elasticsearch query rule type](https://www.elastic.co/guide/en/kibana/current/rule-type-es-query.html), using an index pattern that uses both indices, and then come up with a query which satisfies your constraints. Both indices would need to use the same time field.

Beyond that, the [Metric Threshold rule type](https://www.elastic.co/guide/en/observability/current/metrics-threshold-alert.html) may be appropriate, but the Observability rule types expect your indices in a certain shape, so this may not be appropriate.

---

<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:** [February 6, 2023, 1:50pm UTC](https://discuss.elastic.co/t/define-multiple-conditions-in-an-alert/322652/3 "2023-02-06T13:50:33Z")

</div>

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