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

How to use entitySelector() to query by host in Data Explorer?

EvaWang
Participant

when I query in Data explorer:

1. I used "builtin:billing.ddu.log.byEntity" query and returned 91 records:

EvaWang_0-1698240750585.png

 

2. then add filter in this query "builtin:billing.ddu.log.byEntity:filter(in("dt.entity.monitored_entity", entitySelector("type(~"HOST~")")))" returned "No data" and no hint of syntax error:

EvaWang_1-1698240767739.png

 

3.  and the details exported using API, all the malricids written are "PROCESS_GROUP_INSTANCE-???":

EvaWang_2-1698240785891.png

 May I ask : is it because ddu.log metric cannot express the data by host? or am i using the wrong query? If I can use "entitySelector" in Metric query, I could query many different entities such as : gateway, cloud instances, services, etc. So please help me.

2 REPLIES 2

victor_balbuena
Dynatrace Mentor
Dynatrace Mentor

That is correct, the split of the dimension is done by process group instance, and not by host. Because of this, you can't split by host on this metric, but you can filter by a specific host or set of hosts by using relationships in the entity selector. For example, in your case, it might look something like:

builtin:billing.ddu.log.byEntity:filter(in("dt.entity.monitored_entity", entitySelector(type(PROCESS_GROUP_INSTANCE),fromRelationships.isProcessOf(type(HOST),entityId(<HOST-ID>)))))

Instead of entityId you can then use whatever entity selector filter you want in there for your host, as per the documentation.

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

What happens if you add ":parents", something as "builtin:billing.ddu.log.byEntity:parents"

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Featured Posts