# Filtering events by Management Zone, Gen3 Dynatrace Dashboard.

**URL:** <https://community.dynatrace.com/t/filtering-events-by-management-zone-gen3-dynatrace-dashboard/48597>\
**Category:** DQL\
**Tags:** dql, management-zones, dynatrace-managed, notebooks, dashboards\
**Created:** [October 29, 2024, 4:48am UTC](https://community.dynatrace.com/t/filtering-events-by-management-zone-gen3-dynatrace-dashboard/48597 "2024-10-29T04:48:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmedrahbi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ahmedrahbi/32/20520_2.png) [@Ahmedrahbi](https://community.dynatrace.com/u/Ahmedrahbi)\
**Post date:** [October 29, 2024, 4:48am UTC](https://community.dynatrace.com/t/filtering-events-by-management-zone-gen3-dynatrace-dashboard/48597/1 "2024-10-29T04:48:16Z")

</div>

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?

```markup
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 😊

---

<div class="post-metadata">

**Author:** ![MaciejNeumann](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@MaciejNeumann](https://community.dynatrace.com/u/MaciejNeumann)\
**Post date:** [January 14, 2025, 1:09pm UTC](https://community.dynatrace.com/t/filtering-events-by-management-zone-gen3-dynatrace-dashboard/48597/2 "2025-01-14T13:09:29Z")

</div>

Hello&nbsp;[@Ahmedrahbi](https://community.dynatrace.com/user/77760),

Could you check out this reply in another thread from&nbsp;[@sinisa\_zubic](https://community.dynatrace.com/user/38283)?  
[Fetch active problems](https://community.dynatrace.com/post/236288#M614)&nbsp;  
You’ll find the answer there on how to fetch and filter out events in the query, which may help with your use case

---

<div class="post-metadata">

**Author:** ![sinisa\_zubic](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sinisa_zubic/32/32498_2.png) [@sinisa\_zubic](https://community.dynatrace.com/u/sinisa_zubic)\
**Post date:** [January 14, 2025, 2:00pm UTC](https://community.dynatrace.com/t/filtering-events-by-management-zone-gen3-dynatrace-dashboard/48597/3 "2025-01-14T14:00:30Z")

</div>

Hi&nbsp;[@Ahmedrahbi](https://community.dynatrace.com/user/77760)

To filter data in Dashboards you should use [segments](https://docs.dynatrace.com/docs/manage/segments)&nbsp;. Please not that the feature is currently “In Preview” and there might be still changes happening to the feature.

Best,  
Sini

---

<div class="post-metadata">

**Author:** ![nathan\_tennant](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@nathan\_tennant](https://community.dynatrace.com/u/nathan_tennant)\
**Post date:** [February 11, 2025, 11:12pm UTC](https://community.dynatrace.com/t/filtering-events-by-management-zone-gen3-dynatrace-dashboard/48597/4 "2025-02-11T23:12:47Z")

</div>

But how do you filter events by management zone? I can’t find that documented anywhere and I see a lot of folks with the question.
