# DQL query

**URL:** <https://community.dynatrace.com/t/dql-query/48203>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed, logs\
**Created:** [October 8, 2024, 8:40am UTC](https://community.dynatrace.com/t/dql-query/48203 "2024-10-08T08:40:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gib80](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@Gib80](https://community.dynatrace.com/u/Gib80)\
**Post date:** [October 8, 2024, 8:40am UTC](https://community.dynatrace.com/t/dql-query/48203/1 "2024-10-08T08:40:10Z")

</div>

Hi All,

I have the below dql query for a dashboard and I need to group the average milliseconds by watchlist per 30 seconds.&nbsp; I’m not sure where I am going wrong, any help is appreciated.

timeseries aml=avg(log.application),by: {elapsedmilliseconds, event.original}, interval:1m, filter: matchesPhrase(application, “Screen”)

| parse event.original, “”“LD '@mt”:’ LD:mt ‘,’ “”"  
| parse event.original, “”“LD 'watchlist”:’ LD:Watchlist ‘,’ “”"  
| filter isNotNull(elapsedmilliseconds)

| fieldsAdd CountofRecords=arraymovingAvg(elapsedmilliseconds, 30)

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [October 13, 2024, 9:46pm UTC](https://community.dynatrace.com/t/dql-query/48203/2 "2024-10-13T21:46:41Z")

</div>

Hi&nbsp;[@Gib80](https://community.dynatrace.com/user/76420)&nbsp;, I think you need to adjust the&nbsp;interval here.

```markup
timeseries aml=avg(log.application),by: {elapsedmilliseconds, event.original}, interval:30, filter: matchesPhrase(application, "Screen")

```

---

<div class="post-metadata">

**Author:** ![Fin\_Ubels](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fin_ubels/32/18008_2.png) [@Fin\_Ubels](https://community.dynatrace.com/u/Fin_Ubels)\
**Post date:** [October 13, 2024, 11:04pm UTC](https://community.dynatrace.com/t/dql-query/48203/3 "2024-10-13T23:04:23Z")

</div>

Hey Gib,

If I understand what you’re looking for correctly I don’t believe this would currently be possible with a timeseries as they have a minimum interval of 1m as mentioned here&nbsp;[Limits for Metrics — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/metrics-limits#upgrading-to-grail). You can change the interval to be smaller but I don’t believe that it would make a difference as they are stored with the 1m granularity.

If you were to query logs directly and then used the maketimeseries command you would be able to achieve smaller intervals as seen below.

 ![Fin_Ubels_0-1728860042315.png](https://global.discourse-cdn.com/dynatrace/original/2X/9/9e5e8850e11d4dc8d8852856a846d38b78aaab8c.png)
