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

DQL to fetch services specific to a host tag

ushaghosh
Visitor

I would like to filter out all  the services based on a host tag, what DQL query would help me fetch that info.

Fetch problems based on host tag.

My managemnet zone has 9 environmnets. I would like to segregate them based on a host tag that I defined on the host. 

1 REPLY 1

StrangerThing
Organizer

You can do something like this to get a list of services where the hosts that run them have a certain tag.

fetch dt.entity.service
| expand dt.entity.host=runs_on[dt.entity.host]
| fieldsAdd entityAttr(dt.entity.host, "tags")
| filter matchesPhrase(dt.entity.host.tags, "App:apptag")
| dedup id
| fields entity.name, id

Featured Posts