# Help with Data Explorer query (filter on disk)

**URL:** <https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418>\
**Category:** Dashboarding\
**Tags:** dynatrace-managed, data-explorer\
**Created:** [June 27, 2023, 5:24pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418 "2023-06-27T17:24:12Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [June 27, 2023, 5:24pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/1 "2023-06-27T17:24:12Z")

</div>

Team,&nbsp; Since Dynatrace doesn’t distinguish between local and NFS mounted disk I need to find a way to fix a Top List graph to exclude disks with ‘\\’ in their name since that would represent NFS mounted disk.&nbsp; The graph shows the top 100 disks in our environment ordered by disk.usedPct.&nbsp; This way we know in advance what disks are filling up and about to trigger alarms.

Here is my Query

builtin:host.disk.usedPct:splitBy(“dt.entity.host”,“dt.entity.disk”):filter(not(contains(“dt.entity.disk”,“\\”))):last:auto:sort(value(avg,descending)):limit(100)

But it essentially results in no change because ‘dt.entity.disk’ isn’t the cosmetic name of the disk but rather the ID ‘DISK-0E49522BDC9250CE’. So, from what I can tell, I can’t filter out things like, give me drives that start with ‘E’ or give me drives that don’t start with ‘\\’.

Am i missing something? Has anyone else had to figure out a solution for this?

---

<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:** [June 27, 2023, 7:41pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/2 "2023-06-27T19:41:15Z")

</div>

[@ct\_27](https://community.dynatrace.com/user/38037)

try this:

builtin:host.disk.usedPct:filter(not(in(“dt.entity.disk”,entitySelector(“type(disk),entityName(~”\\~“)”)))):splitBy(“dt.entity.host”,“dt.entity.disk”):last:auto:sort(value(avg,descending)):limit(100)

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [June 27, 2023, 8:32pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/3 "2023-06-27T20:32:40Z")

</div>

unfortunately it did not, but you have a great idea to use the entity selector.&nbsp; I’m going to follow that lead and see where it takes me.

---

<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:** [June 28, 2023, 12:34pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/4 "2023-06-28T12:34:20Z")

</div>

That’s odd, it worked just well to me. What are you getting with this query? Still returning '\\…" disks?

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [June 28, 2023, 4:36pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/5 "2023-06-28T16:36:56Z")

</div>

[UPDATE 6/28 CT\_27]

Nevermind…once i applied the management zone it brought more things into view and a ‘\\’ re-appeared.

 ![ct_27_0-1687970788707.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/acb78670c6e0d7d4a7f0b25bd6fac38bbc9c167a.png)

(sorry for the heavy redaction)

[@dannemca](https://community.dynatrace.com/user/18264)&nbsp;it works now. Ok, so I know a computer only does what you tell it and I totally pasted in your suggested query yesterday, as did my co-worker. It was still showing disks that started with ‘\\’. We even then tried to adjust the query to get it working.&nbsp; It always showed disks with ‘\\’.

I went in just now to give it a another try because I believe you when you said it worked for you.&nbsp; Sure enough, it worked instantly as you said it would.

Like many things in DT, I simply can’t explain it. But ultimately it is the solution to my problem and I am very appreciative of it.&nbsp; Thank you again, this is great.

---

<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:** [June 28, 2023, 5:17pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/6 "2023-06-28T17:17:38Z")

</div>

Even I can’t get the proper result anymore… gee. I sure, it worked yesterday, and I did used a specific MZ that contains only Windows boxes to avoid this “no \\ on result anyway”.

😞

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [June 28, 2023, 7:39pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/7 "2023-06-28T19:39:26Z")

</div>

This could be a bigger issue than i expected…DT at some point in the past few weeks changed the way it detects drives.&nbsp; Instead of just local and mapped drives shows, DT now detects any drive your computer ever touched. That includes network drives that may be holding say your AD Profile.&nbsp; If that drive ever goes above a programmed threshold there is potential for DT to trigger an alert every time a machine accesses the drive which is over the threshold.&nbsp; &nbsp;Digging into this more to understand what Dynatrace has changed and what the potential risk and impact are.

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [July 11, 2023, 2:27pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/8 "2023-07-11T14:27:04Z")

</div>

Because the negate does not appear to work a co-worker approached the issue from the other direction.&nbsp; He’s instead including most of the letter drives from A-Z.

builtin:host.disk.usedPct:filter(and(or(in(“dt.entity.host”,entitySelector(“type(host),tag(~“DiskMonitor:Global~”)”))),or(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“I:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“Z:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“P:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“K:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“N:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“L:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“F:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“D:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“T:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“J:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“H:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“M:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“G:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“E:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“X:\~”)”)),in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“C:\~”)”))))):splitBy(“dt.entity.host”,“dt.entity.disk”):sort(value(auto,descending)):limit(100)

---

<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:** [July 11, 2023, 5:25pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/9 "2023-07-11T17:25:53Z")

</div>

Lucky you it is not the entire alphabet​😅

---

<div class="post-metadata">

**Author:** ![chris\_oggeri](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@chris\_oggeri](https://community.dynatrace.com/u/chris_oggeri)\
**Post date:** [July 11, 2023, 6:08pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/10 "2023-07-11T18:08:56Z")

</div>

Hi,

It is weird that the solution provided by&nbsp;[@dannemca](https://community.dynatrace.com/user/18264)&nbsp;is not working for you. I tried on my side and it seems to work as expected.

Anyway, for your last query, maybe something like this could be easier to read/modify?

```python
builtin:host.disk.usedPct:filter(and(or(in("dt.entity.host",entitySelector("type(host),tag(~"DiskMonitor:Global~")"))),or(in("dt.entity.disk",entitySelector("type(disk),entityName.in(~"I:\~",~"Z:\~",~"P:\~",~"K:\~",~"N:\~",~"L:\~",~"F:\~",~"D:\~",~"T:\~",~"J:\~",~"H:\~",~"M:\~",~"G:\~",~"E:\~",~"X:\~",~"C:\~")"))))):splitBy("dt.entity.host","dt.entity.disk"):sort(value(auto,descending)):limit(100)

```

or even

```python
builtin:host.disk.usedPct:filter(and(or(in("dt.entity.host",entitySelector("type(host),tag(~"DiskMonitor:Global~")"))),or(in("dt.entity.disk",entitySelector("type(disk),entityName.contains(~":\~")"))))):splitBy("dt.entity.host","dt.entity.disk"):sort(value(auto,descending)):limit(100)

```

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [July 12, 2023, 4:58pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/11 "2023-07-12T16:58:50Z")

</div>

Thank you, I merged what you had along with what&nbsp;[@dannemca](https://community.dynatrace.com/user/18264)&nbsp;provided and ended up with the below.&nbsp; I agree what Dan provided should have 100% worked and it does 99%.&nbsp; I think there is a bug in DT because of the 1,000 results I get in a table I have just one drive that seems to squeeze in that starts with \\. It makes no sense.

Ultimately we landed here which is a merger of all the suggestions.

```markup
builtin:host.disk.usedPct:filter(
and(
	or(
	in("dt.entity.host",entitySelector("type(host),tag(~"DiskMonitor:Global~")"))
	),
	or(
not(in("dt.entity.disk",entitySelector("type(disk),entityName.contains(~"\\~")")))
	),
	or(
not(in("dt.entity.disk",entitySelector("type(disk),entityName.contains(~"~/~")")))
	)
)
):splitBy("dt.entity.host","dt.entity.disk"):sort(value(auto,descending)):limit(100)

```

Once things cleared up we then started to see more drives with ‘/root’ showing up so we added that to the query.&nbsp; We did try not(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.in(~”\\~“,~”/~“)”))) but got bad results.

I am thankful to all of you for helping provide a solution.

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 5, 2024, 2:27pm UTC](https://community.dynatrace.com/t/help-with-data-explorer-query-filter-on-disk/40418/12 "2024-08-05T14:27:53Z")

</div>

Hi Chris

builtin:host.disk.free:filter(and(or(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~”/obidata~“)”))),  
or(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~”/opt~“)”)))))  
:splitBy(“dt.entity.host”,“dt.entity.disk”):avg:sort(value(avg,descending))

What is the issue with above query?, when we execute, output is coming. when we combine it is not coming
