# Conditional alerting on Anomaly Detector

**URL:** <https://community.dynatrace.com/t/conditional-alerting-on-anomaly-detector/55909>\
**Category:** DQL\
**Tags:** dql, anomaly-detection\
**Created:** [May 14, 2026, 10:16am UTC](https://community.dynatrace.com/t/conditional-alerting-on-anomaly-detector/55909 "2026-05-14T10:16:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![g\_kat](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/g_kat/32/34573_2.png) [@g\_kat](https://community.dynatrace.com/u/g_kat)\
**Post date:** [May 14, 2026, 10:16am UTC](https://community.dynatrace.com/t/conditional-alerting-on-anomaly-detector/55909/1 "2026-05-14T10:16:45Z")

</div>

Hi,

I have been trying to create the following Anomaly Detector configuration:

evaluate the average&nbsp;dt.host.cpu.usage for a host group and alert if it’s above 80%.

The tricky part is that I want to generate a conditional alert based on the value: e.g. 80\<cpu\<90 generates a warning, cpu\>90 generates a critical. I can’t seem to be able to set up the criticality dimension to the event title/properties.

The latest query I have is below, but whenever I include criticality in the dimensions it messes up the result.

```markup
timeseries cpu_usage = avg(dt.host.cpu.usage), filter: contains(dt.host_group.id, "XXXX"), by:{host.name,dt.source_entity}
| expand cpu_usage 
| fieldsAdd criticality = if(cpu_usage >= 90, "critical", else: "warning")
| fieldsAdd raise_problem = if(cpu_usage >= 80, 1, else: 0)
| summarize raise_problem = collectArray(raise_problem), by: {host.name, timeframe,interval,dt.source_entity, criticality}

```

Thanks,

George

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [May 14, 2026, 10:53am UTC](https://community.dynatrace.com/t/conditional-alerting-on-anomaly-detector/55909/2 "2026-05-14T10:53:21Z")

</div>

Hi,

Let me share this thread also. We were talking also about two timeries metric data and apply some conditional logic:

[https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298214](https://community.dynatrace.com/post/298214)

Best regards

---

<div class="post-metadata">

**Author:** ![g\_kat](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/g_kat/32/34573_2.png) [@g\_kat](https://community.dynatrace.com/u/g_kat)\
**Post date:** [May 14, 2026, 11:55am UTC](https://community.dynatrace.com/t/conditional-alerting-on-anomaly-detector/55909/3 "2026-05-14T11:55:29Z")

</div>

Hi,

My case is a bit different, getting the multiple conditions isn’t that hard, the problem lies in creating a modifiable alert based on that.

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [May 14, 2026, 12:53pm UTC](https://community.dynatrace.com/t/conditional-alerting-on-anomaly-detector/55909/4 "2026-05-14T12:53:34Z")

</div>

Hi,

As you can see in link, DQL output is “1” or “0” base on condition are meet or not.

Later you just create an anomaly detector using that DQL and saying below 1, or above 0.

Best regards
