06 Apr 2024 04:24 PM - last edited on 08 Apr 2024 08:44 AM by MaciejNeumann
I am fairly good at using the V2 API for extracting statistics, but here is one question that I need help on.
How can I enhance a normal topN query for servers to only include server entities with 2 CPUs?
Here us my simple base query:
builtin:host.cpu.usage:splitBy("dt.entity.host"):sort(value(auto,descending)):limit(20)
Any advice appreciated.
Thanks,
Lou
Solved! Go to Solution.
08 Apr 2024 01:52 PM
Hi @crabbylou ,
Properties aren't directly accessible via EntitySelectors, but You can workaround it using TAGS.
You can create autotagging rule to use CoreCount (logical AIX or any You Like) to create such tags, and then use those tags in EntitySelector.
Bests
Michal
08 Apr 2024 02:06 PM
I think I got it. It was a bit cryptic in API query land. This seemed to work:
builtin:host.cpu.usage:filter(in("dt.entity.host", entitySelector("type(~"HOST~"),virtualCpus(2)"))):sort(value(auto,descending)):limit(20)
Thanks Michal and All!