09 Jun 2023 04:37 PM - last edited on 15 Jun 2023 09:59 AM by Ana_Kuzmenchuk
I have a single metric but there are two different entity types I'd like to include: hosts and custom devices.
Custom devices:
nagios._Check_CPU_Stats.iowait.percent:filter(and(or(in("dt.entity.custom_device",entitySelector("type(custom_device),entityName.equals(~"blah1~")")),in("dt.entity.custom_device",entitySelector("type(custom_device),entityName.equals(~"blah2~")"))))):splitBy("dt.entity.custom_device"):sort(value(auto,descending)):limit(20)
Hosts:
nagios._Check_CPU_Stats.iowait.percent:filter(and(or(in("dt.entity.host",entitySelector("type(host),entityName.equals(~"blah3~")")),in("dt.entity.host",entitySelector("type(host),entityName.equals(~"blah4~")")),in("dt.entity.host",entitySelector("type(host),entityName.equals(~"blha5~")")),in("dt.entity.host",entitySelector("type(host),entityName.equals(~"blah6~")"))))):splitBy("dt.entity.host"):sort(value(auto,descending)):limit(20)
Both queries are for io waittime and it works well on a graph:
But when I change from graph to single value I have to pick one query or the other.
Is there a way to combine the two in a single query?
15 Jun 2023 12:06 AM
Hi @paulito,
to be honest, I'm not sure if the following sample query will work or not, but you can give it a try for the single value and let me know,
nagios._Check_CPU_Stats.iowait.percent:filter(and(or(in("dt.entity.custom_device",entitySelector("type(custom_device),entityName.equals(~"blah1~")")),in("dt.entity.custom_device",entitySelector("type(custom_device),entityName.equals(~"blah2~")")),in("dt.entity.host",entitySelector("type(host),entityName.equals(~"blah3~")")),in("dt.entity.host",entitySelector("type(host),entityName.equals(~"blah4~")")),in("dt.entity.host",entitySelector("type(host),entityName.equals(~"blha5~")")),in("dt.entity.host",entitySelector("type(host),entityName.equals(~"blah6~")"))))):limit(20)