29 Oct 2024 04:48 AM - last edited on 29 Oct 2024 07:25 AM by MaciejNeumann
Hello, Dynatrace Community!
I’m working with Gen3 DQL and trying to filter events based on a specific management zone, specifically for the “xxxx” management zone. I attempted the query in Gen3, and I’m attaching a screenshot of my code for reference.
However, I’ve noticed a discrepancy: when I apply the management zone filter in the older DQL version, the results differ from what I’m getting in Gen3 DQL. This leads to the following questions:
1. What is the correct DQL syntax for Gen3 dashboards to properly filter by management zone?
2. How should I modify my query to ensure that only events associated with the “xxx” management zone are displayed?
fetch events
| filter event.kind == "DAVIS_PROBLEM"
| sort timestamp desc
| lookup [
fetch dt.entity.host
| expand managementZones
], sourceField:effected_entity_ids, lookupField:id, prefix:"mzone."
| summarize {status = takeFirst(event.status),
event.name = takeFirst(event.name),
severityLevel = takeFirst(event.category),
managmentzone = takeFirst(affected_entities.management_zones.names
),
affected = takeFirst(affected_entity_ids)},
by:{display_id}
| fieldsAdd Status = if((status == "ACTIVE")," OPEN",
else:if((status == "CLOSED"),"🟢 CLOSED"))
| fields Status, display_id, event.name,affected, severityLevel, managmentzone
Thank you for your help!
ahmed alrahbi 😊