# How to List Hosts that consume more then x% of CPU or Memory in Data explorer?

**URL:** <https://community.dynatrace.com/t/how-to-list-hosts-that-consume-more-then-x-of-cpu-or-memory-in-data-explorer/40834>\
**Category:** Open Q&A\
**Tags:** dynatrace-managed, data-explorer, hosts-classic, dashboards-classic\
**Created:** [July 22, 2023, 2:08am UTC](https://community.dynatrace.com/t/how-to-list-hosts-that-consume-more-then-x-of-cpu-or-memory-in-data-explorer/40834 "2023-07-22T02:08:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![theharithsa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theharithsa/32/16236_2.png) [@theharithsa](https://community.dynatrace.com/u/theharithsa)\
**Post date:** [July 22, 2023, 2:08am UTC](https://community.dynatrace.com/t/how-to-list-hosts-that-consume-more-then-x-of-cpu-or-memory-in-data-explorer/40834/1 "2023-07-22T02:08:46Z")

</div>

Greetings All,

I’ve got a question for those proficient in using Data Explorer and creating dashboards.

I aim to create a chart that only displays hosts consuming more than a specified percentage of CPU or Memory at any given moment. For instance, if **Host A’s** CPU consumption exceeds _70% within a 24-hour period_, I would want that host to be displayed on my chart. However, all other hosts that don’t meet this threshold should not appear.

I’ve attempted to accomplish this with a specific query, but unfortunately, it resulted in all the hosts being listed. Can anyone assist me in this matter? Your help would be much appreciated.

```markup
builtin:host.cpu.usage:splitBy("dt.entity.host"):avg:auto:sort(value(avg,descending)):filter(series(auto,ge(70)))

```

Above is the query that I used.

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [July 22, 2023, 9:05am UTC](https://community.dynatrace.com/t/how-to-list-hosts-that-consume-more-then-x-of-cpu-or-memory-in-data-explorer/40834/2 "2023-07-22T09:05:11Z")

</div>

Hi&nbsp;[@theharithsa](https://community.dynatrace.com/user/39872)

Its look like your query is working just fine ( see below with 45and 60)

 ![Yosi_Neuman_2-1690016654379.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/e/9e884b0bfa551f8255a18f6956984920e366c3b1.png)

 ![Yosi_Neuman_3-1690016672396.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/4/e475803400d93ec42efb9ba3d96b76541d930fd1.png)

Can you please share your results ?

Yos

---

<div class="post-metadata">

**Author:** ![theharithsa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theharithsa/32/16236_2.png) [@theharithsa](https://community.dynatrace.com/u/theharithsa)\
**Post date:** [July 24, 2023, 6:33pm UTC](https://community.dynatrace.com/t/how-to-list-hosts-that-consume-more-then-x-of-cpu-or-memory-in-data-explorer/40834/3 "2023-07-24T18:33:13Z")

</div>

I observed that we need to be careful in selecting the aggregation for the selector function, especially inside the series. If we use avg, it will take the average of all the chosen timeframes; hence, if we’re looking for the data that is displayed in the graph, which gives the average CPU for the selected timeframe where in the given resolution period if the value is more than mentioned percentage. So the final query would be like this,

```c-mrkdwn__pre
builtin:host.cpu.usage:splitBy("dt.entity.host"):avg:sort(value(avg,descending)):filter(series(max,ge(75)))

```

This will give us a chart of the average CPU usage % of the hosts in the given timeframe where on the resolution if any data point reaches more than 75%, it will list that host under this condition.
