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

Excluding certain entities from data explorer query

paulito
Frequent Guest

First off we're using a custom extension so hopefully that doesn't put us in too much of a bind but here is our query:

 

nagios._Check_CPU_Load.load1:filter(and(or(in("dt.entity.custom_device",entitySelector("type(custom_device),fromRelationship.isInstanceOf(type(CUSTOM_DEVICE_GROUP),entityName.equals(~"Blahblahblah~"))"))))):splitBy("dt.entity.custom_device"):sort(value(auto,descending))

 

This gives us a list of devices. We'd like to exclude 3 devices from this query. These 3 devices have a common word in their name: "test". 

 

Is there something we can add to our existing query so that those 3 devices are excluded?

3 REPLIES 3

stemos
Dynatrace Helper
Dynatrace Helper

The following embedded entity selector can be used: 

"type(custom_device),not(entityName.contains(~"test~")),fromRelationship.isInstanceOf(type(CUSTOM_DEVICE_GROUP),entityName.equals(~"Blahblahblah~"))"

 

Thank you so much, this works. Would there be a way to exclude multiple entities that have unique names?

stemos
Dynatrace Helper
Dynatrace Helper

Yes, you can exclude unique names by:

"type(custom_device),not(entityName.in(~"full_device_name1~",~"full_device_name2~",~"full_device_name3~"))"

If you want to exclude multiple devices based on the contains filter, you can achieve this like shown in this example:

"type(custom_device),not(entityName.contains(~"abc~")),not(entityName.contains(~"cbd~")),not(entityName.contains(~"bde~"))"

 

Featured Posts