12 Mar 2025
10:59 AM
- last edited on
13 Mar 2025
07:04 AM
by
MaciejNeumann
I want to get a field with only a certain key:value tag using DQL.
example: Host Name | Host group name | Datacentre:xyz
this Datacentre tag is already defined in my environment.
How to achieve it?
Solved! Go to Solution.
12 Mar 2025 12:24 PM - edited 12 Mar 2025 12:42 PM
Here you go:
fetch dt.entity.host
| fieldsAdd tags, hostGroupName
| filter matchesValue(tags,"TagName")
12 Mar 2025 12:52 PM
Slightly improved
fetch dt.entity.host
| fieldsAdd tags, hostGroupName
| expand tags
| filter contains(tags,"Datacentre")
| fields entity.name, hostGroupName, tags
12 Mar 2025 01:21 PM
Working. Thanks!
12 Mar 2025 02:59 PM
I found a great use case for this today!!! love this