Filter one disk from builtin:host.disk.usedPct with /metrics/query

Hi guys,

Is there a way to set entitySelector to get information for specific disk from builtin:host.disk.usedPct metric with /metrics/query rest call?

When filtering by host

Yosi_Neuman_0-1652775459477.png

We get answer with value

When trying to filter by disk

Yosi_Neuman_2-1652775663336.png

We get empty answer

Is that a bug or a feature or something that I have done wrong ?

Thanks in advance for your input on this question

Yos

It seems like the issue may be that for some of the older metrics the primary entity must be included in the selector which for this metric is the host and that approach doesn’t include that when filtering to the disk in the entity selector.

I did try a few alternatives though where you can include the disk id filter in the query itself to get the same desired result.

Using entity selector still, just in the metric selector as a filter:
builtin:host.disk.usedPct:filter(in("dt.entity.disk",entitySelector("entityId("DISK-XXXXXXXX")"))):splitBy("dt.entity.disk")

Just filtering on the disk id itself without a selector:
builtin:host.disk.usedPct:filter(eq("dt.entity.disk", "DISK-XXXXXXXX")):splitBy("dt.entity.disk")

Hi @JamesKitson

Thanks for your reply.

This filter works perfectly when using it within Data explorer code.

Our issue is when trying to convert this filter to rest api entitySelector

Any suggestion how to convent this filter to entitySelector?

Yos

You can add the filters (either the entity selector approach or the somewhat simpler disk dimension filter) in the metricSelector field of the API call. When you add the disk entity selector in that entitySelector field it filters out the host which needs to be present for this metric as that is it’s ‘primary’ dimenions.

So don’t use the entitySelector field and just put the whole thing (including the filter) in the metricSelector field:

Thanks again @JamesKitson

Will use this

All the best

Yos

@Yosi_Neuman  - Is it possible to negate a single mount point or list of mount points in metric selector?

Thanks in advance!

Srikanth

Hi @SrikanthSamraj

You can use the Negate criterion with in the entity selector

Yosi_Neuman_0-1713027740761.png

Yosi_Neuman_1-1713028006272.png

HTH

Yos

Thanks James

How do add multiple disks or hosts in the above query?

I’ve used something like below to exclude multiple disks..

builtin:host.disk.usedPct:filter(and(or(in(“dt.entity.host”,entitySelector(“type(host),tag(~“XXX:XXX~”),tag(~“XXX:XXX~”),tag(~”[Environment]XXX:XXX~“),tag(~”[Environment]XXX:XXX~“)”))),not(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.in(~”/~“,~”/dev~“,~”/boot~“,~”/boot/efi~“,~”/admin~“,~”/audit~“,~”/home~“,~”/home2~“,~”/mksysbfs~“,~”/opt~“,~”/backup/Config~“,~”/opt/core~“,~”/opt/DoOnceAIX~“,~”/opt/samgr/systemlogs~“,~”/proc~“,~”/sys~“,~”/tmp~“,~”/users~“,~”/usr~“,~”/usr/local/lrs~“,~”/var~“,~”/var/adm/perfmgr~“,~”/var/adm/ras/livedump~“,~”/var/cache/yum~“,~”/var/crash~“,~”/var/log~“,~”/var/log/audit~“,~”/var/perf~“,~”/var/perf/pm~“,~”/var/spool/lpd/qdir~“,~”/var/spool/qdaemon~“,~”/rpool~“,~”/var/cache/dnf~")")))))

Thanks

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 i execute separately it is working and when i combine it is not giving any result.