# Show a top 20 list of servers that consume the most disk space

**URL:** <https://community.dynatrace.com/t/show-a-top-20-list-of-servers-that-consume-the-most-disk-space/54315>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed\
**Created:** [December 5, 2025, 3:42pm UTC](https://community.dynatrace.com/t/show-a-top-20-list-of-servers-that-consume-the-most-disk-space/54315 "2025-12-05T15:42:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MillerGEP](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@MillerGEP](https://community.dynatrace.com/u/MillerGEP)\
**Post date:** [December 5, 2025, 3:42pm UTC](https://community.dynatrace.com/t/show-a-top-20-list-of-servers-that-consume-the-most-disk-space/54315/1 "2025-12-05T15:42:57Z")

</div>

Hi Everyone.&nbsp;I’m trying to create a dashboard with a top 20 list of servers that consume the most disk space. I’m using this DQL, but it’s not working. I think it’s because I don’t have the dt.host.disk.total metric. So, which one can I use? What do you recommend?

timeseries {used=avg(dt.host.disk.used), total=avg(dt.host.disk.total)}, by:{dt.host.name,dt.host.disk.name}  
| fieldsAdd capacidad=arrayAvg(total), usado=arrayAvg(used)  
| fieldsAdd Porcentaje\_Usado=(usado\*100)/capacidad  
| sort Porcentaje\_Usado desc  
| fieldsRename Host=dt.host.name, Disco=dt.host.disk.name  
| fields Host, Disco, capacidad, usado, Porcentaje\_Usado  
| limit 20

 ![MillerGEP_0-1764949202515.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/7f6498b848550edab706d5bdf8f15c1564250aca.png)

Any idea ?

---

<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:** [December 8, 2025, 5:19am UTC](https://community.dynatrace.com/t/show-a-top-20-list-of-servers-that-consume-the-most-disk-space/54315/2 "2025-12-08T05:19:12Z")

</div>

[@MillerGEP](https://community.dynatrace.com/user/74933)&nbsp;You can try something like below for total

```markup
| fieldsAdd 
 Disk = entityName(dt.entity.disk),
 Free = arrayLast(`avg(dt.host.disk.free)`),
 Space_Used = arrayLast(`avg(dt.host.disk.used)`),
 Space_Available = arrayLast(`avg(dt.host.disk.avail)`)
| fieldsAdd Space_Total = Space_Used + Space_Available

```

---

<div class="post-metadata">

**Author:** ![MillerGEP](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@MillerGEP](https://community.dynatrace.com/u/MillerGEP)\
**Post date:** [December 9, 2025, 2:31pm UTC](https://community.dynatrace.com/t/show-a-top-20-list-of-servers-that-consume-the-most-disk-space/54315/3 "2025-12-09T14:31:02Z")

</div>

Hi&nbsp;[@p\_devulapalli](https://community.dynatrace.com/user/21657)&nbsp; thanks for the sugerence. I don’t know if i doing something bad, because isn’t working.

The message indicate that dt.host.disk.free doesn’t exist ----\>

 ![MillerGEP_0-1765290453341.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/6/0699768f1084f32ba26f1e0850cc3636c9fb1a2c.png)

And i see that metric only work for f5 hosts and my dashboard is for host with oneagent installed…

 ![MillerGEP_1-1765290621295.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/1/f1ef6468b9799bf9d910853c57f2ea4df7ea9cff.png)

Any idea ?

---

<div class="post-metadata">

**Author:** ![JeanBlanc](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jeanblanc/32/25897_2.png) [@JeanBlanc](https://community.dynatrace.com/u/JeanBlanc)\
**Post date:** [December 9, 2025, 3:50pm UTC](https://community.dynatrace.com/t/show-a-top-20-list-of-servers-that-consume-the-most-disk-space/54315/4 "2025-12-09T15:50:11Z")

</div>

Hi&nbsp;[@MillerGEP](https://community.dynatrace.com/user/74933),

Dynatrace provide the following DQL to get 15 hosts with highest utilization (5 highest CPU, 5 highest memory, 5 highest disk usages) :

fetch dt.entity.host  
| filter id in [

timeseries { CPU=avg(dt.host.cpu.usage) }, by: {dt.entity.host}  
| fieldsAdd CPU=arrayLast(CPU)  
| filterOut isNull(CPU)  
| sort CPU desc  
| limit 5

| append [  
timeseries { Memory=avg(dt.host.memory.usage) }, by: {dt.entity.host}  
| fieldsAdd Memory=arrayLast(Memory)  
| filterOut isNull(Memory)  
| sort Memory desc  
| limit 5  
]

| append [  
timeseries { Disk=avg(dt.host.disk.used.percent) }, by: {dt.entity.host}  
| fieldsAdd Disk=arrayLast(Disk)  
| filterOut isNull(Disk)  
| sort Disk desc  
| limit 5  
]

| dedup dt.entity.host  
| fields dt.entity.host  
]

| lookup [  
timeseries {  
CPU=avg(dt.host.cpu.usage),  
Memory=avg(dt.host.memory.usage),  
Disk=avg(dt.host.disk.used.percent)  
}, by: {dt.entity.host}  
| fields CPU=arrayLast(CPU), Memory=arrayLast(Memory), Disk=arrayLast(Disk), dt.entity.host  
], sourceField:id, lookupField:dt.entity.host, fields: {CPU, Memory, Disk, dt.entity.host}, executionOrder:leftFirst

| fields Name=entity.name, dt.entity.host, CPU, Memory, Disk

Is that OK for you ?

Regards,

---

<div class="post-metadata">

**Author:** ![MillerGEP](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@MillerGEP](https://community.dynatrace.com/u/MillerGEP)\
**Post date:** [December 9, 2025, 4:41pm UTC](https://community.dynatrace.com/t/show-a-top-20-list-of-servers-that-consume-the-most-disk-space/54315/5 "2025-12-09T16:41:45Z")

</div>

Hi&nbsp;[@JeanBlanc](https://community.dynatrace.com/user/48146)&nbsp; i think that maybe this DQL working for me. But I have 2 questions:

1) What disk/unit/filesystem consume the percentage, disk C or D or /opt, the dql show the consume of disk but not indicate wich.

2) How can only show data of host that have installed oneagent, on the screen you can see name like dispatcher.resolution, bank-integrator wich isn’t clear if is a server.

 ![MillerGEP_0-1765297923903.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/1/e1015b3e5db2822acf3e138f05cbd0bee575deab.png)

---

<div class="post-metadata">

**Author:** ![Pierre\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pierre_l/32/23722_2.png) [@Pierre\_L](https://community.dynatrace.com/u/Pierre_L)\
**Post date:** [December 9, 2025, 7:01pm UTC](https://community.dynatrace.com/t/show-a-top-20-list-of-servers-that-consume-the-most-disk-space/54315/6 "2025-12-09T19:01:33Z")

</div>

Hi&nbsp;[@MillerGEP](https://community.dynatrace.com/user/74933)&nbsp;,

I suggest to add 2 dimensions in your query : dt.entity.disk and dt.metric.source

Then you have to do a lookup to fetch disk name.

A step by step query like this should help you (starting on the lookup part of your query) :

```markup
| lookup [
timeseries {
Disk=avg(dt.host.disk.used.percent)
}, by: {dt.entity.host,dt.entity.disk,dt.metrics.source}
| fields Disk=arrayLast(Disk), dt.entity.host, dt.entity.disk, dt.metrics.source
], sourceField:id, lookupField:dt.entity.host, fields: {Disk, dt.entity.host, dt.entity.disk,dt.metrics.source}, executionOrder:leftFirst

| fields Name=entity.name, dt.entity.host, Disk, DiskId=dt.entity.disk, DataSource=dt.metrics.source

| lookup [
fetch dt.entity.disk
| fields id, entity.name
 ], sourceField:DiskId , lookupField:id, fields:{entity.name}, executionOrder:leftFirst
| fields Name, Disk, DiskName=entity.name, DataSource

```

Hope this helps !

---

<div class="post-metadata">

**Author:** ![MillerGEP](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@MillerGEP](https://community.dynatrace.com/u/MillerGEP)\
**Post date:** [January 29, 2026, 3:57pm UTC](https://community.dynatrace.com/t/show-a-top-20-list-of-servers-that-consume-the-most-disk-space/54315/7 "2026-01-29T15:57:38Z")

</div>

This was a solutions for me…

 ![MillerGEP_0-1769701996680.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/f/1ff858fed7cb7356190ace6a1b57e12c7bd57062.png)

/\* 1.&nbsp; Hosts with OneAgent that have TOP disks --------------\*/

fetch dt.entity.host

| filter id in [

timeseries disk = avg(dt.host.disk.used.percent),

by: {dt.entity.host, dt.entity.disk}

| fieldsAdd disk = arrayLast(disk)

| filterOut isNull(disk)

| sort disk desc

| limit 30

| dedup dt.entity.host

| fields dt.entity.host

]

/\* 2.&nbsp; Disks of those hosts (we bring in id, disk and keep id as HostId) ---\*/

| lookup [

timeseries disk = avg(dt.host.disk.used.percent),

by: {dt.entity.host, dt.entity.disk, dt.metrics.source}

| fields disk&nbsp;&nbsp; = arrayLast(disk),

dt.entity.host,

dt.entity.disk,

dt.metrics.source

], sourceField: id, lookupField: dt.entity.host, fields: {disk, dt.entity.host, dt.entity.disk, dt.metrics.source}

/\* 3.&nbsp; Readable disk name -----------------------------\*/

| lookup [

fetch dt.entity.disk

| fields id, entity.name

], sourceField: dt.entity.disk, lookupField: id, fields: {entity.name}

/\* 4. Readable disk host ------------------------------\*/

| fieldsAdd HostName = entityName(dt.entity.host)

/\* 5.&nbsp; Final exit -----------------------------------------\*/

| fields

HostName,

DiskName&nbsp;&nbsp;&nbsp; = entity.name,

DiskUsedPct = disk,

DataSource&nbsp; = dt.metrics.source

| sort DiskUsedPct desc

 ![MillerGEP_1-1769702238546.png](https://global.discourse-cdn.com/dynatrace/original/2X/9/9c4db408ae1ebd57cbb6e1f9e66710e803e67e10.png)
