cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Combining two entity types in a single Data Explorer query

paulito
Frequent Guest

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:

paulito_0-1686324661750.png

 

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?

 

1 REPLY 1

Mohamed_Hamdy
DynaMight Champion
DynaMight Champion

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)

 

Certified Dynatrace Professional | Certified Dynatrace Services Delivery - Observability & CloudOps | Dynatrace Partner - yourcompass.ca

Featured Posts