# DQL - Anomaly detector interval 1m

**URL:** <https://community.dynatrace.com/t/dql-anomaly-detector-interval-1m/55385>\
**Category:** DQL\
**Tags:** dql, anomaly-detection\
**Created:** [March 27, 2026, 8:07am UTC](https://community.dynatrace.com/t/dql-anomaly-detector-interval-1m/55385 "2026-03-27T08:07:49Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [March 27, 2026, 8:07am UTC](https://community.dynatrace.com/t/dql-anomaly-detector-interval-1m/55385/1 "2026-03-27T08:07:49Z")

</div>

Hi,

I would like to create an anomaly detector disk alert when disk is higher than some value. I am trying it using this DQL:

```markup
timeseries t_disk = avg(dt.host.disk.used.percent),
filter: {
  matchesValue(role, "ORACLE") AND
  matchesValue(entityAttr(dt.entity.disk, "entity.name"), "/opt")
}, by:{dt.entity.host, dt.entity.disk}, interval: 1m
| fieldsAdd server = entityName(dt.entity.host)
| fieldsAdd disk = entityName(dt.entity.disk)
| fieldsAdd `disk_used` = arrayAvg(t_disk)
| fieldsRemove interval, t_disk
| join [
    timeseries disk.used_sum = avg(dt.host.disk.used), disk.avail_sum = avg(dt.host.disk.avail), by:{dt.entity.disk}
    | fieldsAdd total_disk = toLong((arrayAvg(disk.used_sum) + arrayAvg(disk.avail_sum)))
    | fieldsKeep total_disk, dt.entity.disk
  ], on:{dt.entity.disk}
| fieldsAdd `disk_size` = right.total_disk
| fieldsRemove right.dt.entity.disk, right.total_disk
| filter `disk_size` > 5000000000

```

I am getting some interval error:

 ![error.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/2/0252fc3c149b1e95d0443061366ff51838679bc9.png)

But I think issue is another thing. Do you have some suggestion? Have you received that error message before?

Best regards

---

<div class="post-metadata">

**Author:** ![t\_pawlak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/t_pawlak/32/14991_2.png) [@t\_pawlak](https://community.dynatrace.com/u/t_pawlak)\
**Post date:** [March 27, 2026, 8:42am UTC](https://community.dynatrace.com/t/dql-anomaly-detector-interval-1m/55385/2 "2026-03-27T08:42:17Z")

</div>

Hi,  
I thinkk the problem is here:  
arrayAvg(t\_disk) collapses the time series into a single value and&nbsp;fieldsRemove interval removes the interval information required by the detector

So for anomaly detection, your query should keep the original time series in the final output, and only use the join for filtering/enrichment. Try this:

```markup
timeseries t_disk = avg(dt.host.disk.used.percent),
filter: {
  matchesValue(entityAttr(dt.entity.disk, "entity.name"), "/boot")
},
by:{dt.entity.host, dt.entity.disk},
interval: 1m
| join [
    timeseries disk.used_sum = avg(dt.host.disk.used),
              disk.avail_sum = avg(dt.host.disk.avail),
              by:{dt.entity.disk},
              interval: 1m
    | fieldsAdd total_disk = toLong(arrayAvg(disk.used_sum) + arrayAvg(disk.avail_sum))
    | fieldsKeep total_disk, dt.entity.disk
  ], on:{dt.entity.disk}
| fieldsAdd server = entityName(dt.entity.host)
| fieldsAdd disk = entityName(dt.entity.disk)
| fieldsAdd disk_size = right.total_disk

```

 ![disk.jpg](https://global.discourse-cdn.com/dynatrace/original/2X/0/0a526c63632c740118bb2a8f2488cbdd0124584d.jpeg)

Of course change filters 😉

---

<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:** [March 27, 2026, 1:57pm UTC](https://community.dynatrace.com/t/dql-anomaly-detector-interval-1m/55385/3 "2026-03-27T13:57:11Z")

</div>

Hi,

You are right, before query should work if this line is removed:

```markup
| fieldsRemove interval, t_disk

```

Thank you!

Best regards
