19 Mar 2025
12:03 PM
- last edited on
21 Mar 2025
01:11 PM
by
IzabelaRokita
Assume that I want to view entities that are present in N different management zones. Since we can’t apply tags at the management zone level, is there another way to achieve this?
Solved! Go to Solution.
19 Mar 2025 04:02 PM
Hi @jmathan305,
What would be the use case? Can you provide a little bit more explanation?
Thanks.
János
20 Mar 2025 09:19 AM
I have 150+ management zones. Some of these zones have entities, while the remaining ones will be added soon. I just need a view of all these zones. In this case, we can't create a zone while trying. We need to incorporate all 150+ zone tags into one, which takes too much time.
19 Mar 2025 08:17 PM
Probably the easiest way in UI is to display a metric in Data Explorer with filter based on entity selector containing zones.
Example for hosts which are in zone1 and zone2:
builtin:host.cpu.user
:filter(and(or(in("dt.entity.host",entitySelector("type(host),mzName(~"zone1~"),mzName(~"zone1~")")))))
:splitBy("dt.entity.host")
Or use the Environment v2 entities API to query such entities.
19 Mar 2025 11:09 PM - edited 19 Mar 2025 11:10 PM
You can execute a Grail query for the entities and then compute the number of elements in the managementZones field.
Example DQL
fetch dt.entity.host
| fieldsAdd mzCount = arraySize(managementZones)
| filter mzCount = 3
The above query will return hosts which belong to exactly three management zones.
21 Mar 2025 01:18 PM - edited 24 Mar 2025 05:51 AM
Hello, @jmathan305!
Do any of the solutions proposed by our Community users work in your case? If so, please let us know by clicking the "accept as a solution" button. And if you still need our assistance - also give us a sign, we'll figure something out. 🙂
EDIT: Thank you for coming back and accepting the solution, that's the Community spirit! 💪 😁