<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Anomaly Detector - Disk monitoring AND condition in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298214#M3305</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to create an Anomaly Detector rule to create a disk problem when two conditions being matched. It is important AND condition is done, not OR:&lt;/P&gt;&lt;P&gt;Idea would be checking 2 timeseries data to match those 2 conditions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Disk % higher than 80%.&lt;/LI&gt;&lt;LI&gt;Disk space lower than X bytes.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;We are using this DQL:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries t_disk_percent = avg(dt.host.disk.used.percent), t_disk_used = avg(dt.host.disk.avail),
  matchesValue(entityAttr(dt.entity.disk, "entity.name"), "/opt")
}, by:{dt.entity.host, dt.entity.disk}, interval: 1m
| fieldsAdd `disk_used_percent` = arrayAvg(t_disk_percent)
| fieldsAdd `disk_used` = arrayAvg(t_disk_used)
| filter `disk_used_percent` &amp;gt; 80 AND `disk_used` &amp;lt; X&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Anomaly detector complains saying:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The query results in multiple metrics, but custom alerts only support single metric.&lt;/LI-CODE&gt;&lt;P&gt;Do you have some idea in mind? Idea can be generating a new metric only when both conditions are applied. Something as "1" when both are matched, otherwise "0".&lt;/P&gt;&lt;P&gt;We cannot use Disk Edge because only OR conditions are allowed and we would like to have AND condition.&lt;/P&gt;&lt;P&gt;Do you have some recommendation? Are you using Anomaly Detector for that?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
    <pubDate>Thu, 23 Apr 2026 11:11:26 GMT</pubDate>
    <dc:creator>AntonPineiro</dc:creator>
    <dc:date>2026-04-23T11:11:26Z</dc:date>
    <item>
      <title>Anomaly Detector - Disk monitoring AND condition</title>
      <link>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298214#M3305</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to create an Anomaly Detector rule to create a disk problem when two conditions being matched. It is important AND condition is done, not OR:&lt;/P&gt;&lt;P&gt;Idea would be checking 2 timeseries data to match those 2 conditions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Disk % higher than 80%.&lt;/LI&gt;&lt;LI&gt;Disk space lower than X bytes.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;We are using this DQL:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries t_disk_percent = avg(dt.host.disk.used.percent), t_disk_used = avg(dt.host.disk.avail),
  matchesValue(entityAttr(dt.entity.disk, "entity.name"), "/opt")
}, by:{dt.entity.host, dt.entity.disk}, interval: 1m
| fieldsAdd `disk_used_percent` = arrayAvg(t_disk_percent)
| fieldsAdd `disk_used` = arrayAvg(t_disk_used)
| filter `disk_used_percent` &amp;gt; 80 AND `disk_used` &amp;lt; X&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Anomaly detector complains saying:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The query results in multiple metrics, but custom alerts only support single metric.&lt;/LI-CODE&gt;&lt;P&gt;Do you have some idea in mind? Idea can be generating a new metric only when both conditions are applied. Something as "1" when both are matched, otherwise "0".&lt;/P&gt;&lt;P&gt;We cannot use Disk Edge because only OR conditions are allowed and we would like to have AND condition.&lt;/P&gt;&lt;P&gt;Do you have some recommendation? Are you using Anomaly Detector for that?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2026 11:11:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298214#M3305</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2026-04-23T11:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Anomaly Detector - Disk monitoring AND condition</title>
      <link>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298224#M3309</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/58682"&gt;@AntonPineiro&lt;/a&gt;, how is going?&lt;/P&gt;&lt;P&gt;You can achieve this with the Anomaly Detector, but the key here is that the rule must evaluate a &lt;STRONG&gt;single&lt;/STRONG&gt; resulting timeseries. That's why your current query is rejected: even though you apply an AND in the filter, the query still starts from two input metrics, and custom alerts expect one final signal. Try something like this bellow, this example I'm using 20GiB:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;timeseries {
  disk_used_percent = avg(dt.host.disk.used.percent),
  disk_avail_bytes  = avg(dt.host.disk.avail)
},
filter: {
  matchesValue(entityAttr(dt.entity.disk, "entity.name"), "/opt")
},
by: { dt.entity.host, dt.entity.disk },
interval: 1m
| fieldsAdd alert_signal = if(
    disk_used_percent[] &amp;gt; 80 AND disk_avail_bytes[] &amp;lt; 21474836480,
    1,
    else: 0
  )
| fieldsKeep dt.entity.host, dt.entity.disk, alert_signal&lt;/LI-CODE&gt;&lt;P&gt;Also, one small correction: dt.host.disk.avail is available space (No?), so I would rename that field to something like disk_avail_bytes to avoid confusion.&lt;/P&gt;&lt;P&gt;I hope it helps &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2026 13:40:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298224#M3309</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-04-23T13:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Anomaly Detector - Disk monitoring AND condition</title>
      <link>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298231#M3312</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your fast feedback.&amp;nbsp;&amp;nbsp;"disk_used_percent[] &amp;gt; 80" is not working fine. It means, no matter if you select "&amp;lt;" or "&amp;gt;", it is always considered as "true".&lt;/P&gt;&lt;P&gt;And it is not allowed in Anomaly detector:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AntonPineiro_0-1776955281295.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/32844i62E91B6DAAD456FF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AntonPineiro_0-1776955281295.png" alt="AntonPineiro_0-1776955281295.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2026 14:41:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298231#M3312</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2026-04-23T14:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Anomaly Detector - Disk monitoring AND condition</title>
      <link>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298238#M3314</link>
      <description>&lt;P&gt;It's failing because the timeframe field is no longer there.&lt;/P&gt;&lt;P&gt;Instead of line 15, do &lt;STRONG&gt;|&amp;nbsp;fieldsRemove disk_used_percent, disk_avail_bytes&lt;/STRONG&gt; to keep everything and only 1 array (alert_signal).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2026 14:54:35 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298238#M3314</guid>
      <dc:creator>sia_h</dc:creator>
      <dc:date>2026-04-23T14:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Anomaly Detector - Disk monitoring AND condition</title>
      <link>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298918#M3325</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you! It works.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2026 10:44:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Anomaly-Detector-Disk-monitoring-AND-condition/m-p/298918#M3325</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2026-05-04T10:44:55Z</dc:date>
    </item>
  </channel>
</rss>

