14 Feb 2024 07:42 PM - last edited on 13 Aug 2024 02:05 PM by GosiaMurawska
Hello,
I am new to Dynatrace and am just learning about dashboards. I've tried to find this info but having no luck. If I add a graph from a host to a new dashboard and look at it in Data Explorer, I can see queries like this:
builtin:host.mem.total:filter(eq("dt.entity.host",hostname))
Can I instead of using a specific hostname, look at hosts that contain a specific property? For example if I click on the host and go to properties and tags I see all the discovered properties like IP addresses, OS version, instance type, security groups, a bunch of stuff. Can all of these properties be used in the query so that I can grab info on multiple hosts that for example have the same property?
Solved! Go to Solution.
14 Feb 2024 08:25 PM - edited 14 Feb 2024 08:32 PM
Hi, @estrella86 , yes you can.
You should get these filters automatically when searching in UI (not advanced mode).
If you do not see the property you need in the list, you can create a tag for it, using it as placeholder: https://docs.dynatrace.com/docs/manage/tags-and-metadata/setup/how-to-define-tags#service-and-proces..., and then, use the tag as filter.
And assuming you wants to use the DQL version, you could try something like this:
timeseries cpu=avg(dt.host.cpu.usage), by:{dt.entity.host}
| sort arrayAvg(cpu), direction:"descending"
| lookup [fetch dt.entity.host], fields:{entity.name, osType, tags}, sourceField:dt.entity.host, lookupField: id
//| expand tags
| filter contains(osType,"LINUX")
| fields entity.name, cpu, interval, timeframe, osType
Just replace the osType by the property you need.