# timeseries result by tag

**URL:** <https://community.dynatrace.com/t/timeseries-result-by-tag/39772>\
**Category:** DQL\
**Tags:** dql\
**Created:** [May 16, 2023, 6:00pm UTC](https://community.dynatrace.com/t/timeseries-result-by-tag/39772 "2023-05-16T18:00:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen1\_Lee](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Stephen1\_Lee](https://community.dynatrace.com/u/Stephen1_Lee)\
**Post date:** [May 16, 2023, 6:00pm UTC](https://community.dynatrace.com/t/timeseries-result-by-tag/39772/1 "2023-05-16T18:00:10Z")

</div>

Hi.

Using DQL how to retrieve timeseries cpu for hosts by tag and then get the max of those hosts.

My syntax isn’t correct.

```auto
timeseries memory=avg(dt.host.cpu.usage),by:{dt.entity.host}, interval:1h
| lookup [fetch dt.entity.host fieldsAdd tags,
],sourceField:dt.entity.host, lookupField:id
| filter matchesValue(tags,"TG.ProcessGroup.DetectedName:Oracle Listeners")
| summarize MaxMem = avg(arrayMax(memory))

```

I’d like to use the final result as an objective in the site reliability guardian.

Thanks

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [May 16, 2023, 7:24pm UTC](https://community.dynatrace.com/t/timeseries-result-by-tag/39772/2 "2023-05-16T19:24:35Z")

</div>

Try this:

```auto
timeseries memory=avg(dt.host.cpu.usage),by:{dt.entity.host}, interval:1h
| lookup [fetch dt.entity.host
| fieldsAdd tags],lookupField:id , sourceField:dt.entity.host
| filter matchesValue(lookup.tags,"TG.ProcessGroup.DetectedName:Oracle Listeners")
| summarize MaxMem = avg(arrayMax(memory))

```

and let us know

---

<div class="post-metadata">

**Author:** ![Stephen1\_Lee](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Stephen1\_Lee](https://community.dynatrace.com/u/Stephen1_Lee)\
**Post date:** [May 17, 2023, 2:30pm UTC](https://community.dynatrace.com/t/timeseries-result-by-tag/39772/3 "2023-05-17T14:30:59Z")

</div>

Hi

I got this error.&nbsp; Note: when I query the dt.entity.hosts alone with the tag value it gives me back 61 records so I assume I have 61 hosts with this tag value.

{  
“error”: {  
“message”: “LOOKUP\_TABLE\_SIZE”,  
“details”: {  
“exceptionType”: “DQL-EXEC-EXECUTION”,  
“errorType”: “LOOKUP\_TABLE\_SIZE”,  
“errorMessage”: “The lookup command’s subquery read too much data. Please continue to filter the lookup table or narrow the query time range.”,  
“arguments”: [],  
“queryString”: “timeseries memory=avg(dt.host.cpu.usage),by:{dt.entity.host}, interval:1h\n| lookup [fetch dt.entity.host\n| fieldsAdd tags],lookupField:id , sourceField:dt.entity.host\n| filter matchesValue(lookup.tags,\“TG.App.DynamicAppName:app\_pddf\”)\n| summarize MaxMem = avg(arrayMax(memory))”,  
“errorMessageFormatSpecifierTypes”: [  
“GENERAL\_MESSAGE”  
],  
“errorMessageFormat”: “The lookup command’s subquery read too much data. Please continue to filter the lookup table or narrow the query time range.”  
},  
“code”: 500  
}  
}

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [May 17, 2023, 4:41pm UTC](https://community.dynatrace.com/t/timeseries-result-by-tag/39772/4 "2023-05-17T16:41:42Z")

</div>

Try to add another filter to the lookup and see if the data is present… if is there a real limit, let’s wait for someone from Dynatrace to explain what it is, since I seen nothing in docs.

edit, only limit I am seeing is this:

- the time interval would have exceeded the limit of elements per series (10,080).

---

<div class="post-metadata">

**Author:** ![stefan\_eggersto](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/stefan_eggersto/32/34114_2.png) [@stefan\_eggersto](https://community.dynatrace.com/u/stefan_eggersto)\
**Post date:** [May 22, 2023, 4:18am UTC](https://community.dynatrace.com/t/timeseries-result-by-tag/39772/5 "2023-05-22T04:18:39Z")

</div>

Hi [@Stephen1\_Lee](https://community.dynatrace.com/user/24856),

to avoid `The lookup command's subquery read too much data. Please continue to filter the lookup table or narrow the query time range`, you can do following:

- move the filter for tags into the lookup query and in the main query, filter for hosts matching the lookup query (`filter isNotNull(lookup.id)`)
- remove the `fieldsAdd tags`, since you dont need the tags as a result, only for filtering

```auto
timeseries memory = avg(dt.host.cpu.usage), by:{dt.entity.host}, interval:1h
| lookup [
  fetch dt.entity.host
  | filter matchesValue(tags, "TG.ProcessGroup.DetectedName:Oracle Listeners")
], lookupField:id, sourceField:dt.entity.host
| filter isNotNull(lookup.id)
| summarize MaxMem = avg(arrayMax(memory))

```

Please give it a try and let me know if this query works!

---

<div class="post-metadata">

**Author:** ![Stephen1\_Lee](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Stephen1\_Lee](https://community.dynatrace.com/u/Stephen1_Lee)\
**Post date:** [May 25, 2023, 12:39am UTC](https://community.dynatrace.com/t/timeseries-result-by-tag/39772/6 "2023-05-25T00:39:47Z")

</div>

Hi

Yes this worked.&nbsp; Thank you very much.

---

<div class="post-metadata">

**Author:** ![Manish\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@Manish\_Kumar](https://community.dynatrace.com/u/Manish_Kumar)\
**Post date:** [June 13, 2025, 11:27am UTC](https://community.dynatrace.com/t/timeseries-result-by-tag/39772/7 "2025-06-13T11:27:50Z")

</div>

This Condition works onthe&nbsp;&nbsp;dashboard, provided by extensions
