# Filter only active hosts, processes, services and applications using entitySelector

**URL:** <https://community.dynatrace.com/t/filter-only-active-hosts-processes-services-and-applications-using-entityselector/52824>\
**Category:** Open Q&A\
**Tags:** windows, management-zones, smartscape, services, entity-selector, processes\
**Created:** [August 6, 2025, 8:44am UTC](https://community.dynatrace.com/t/filter-only-active-hosts-processes-services-and-applications-using-entityselector/52824 "2025-08-06T08:44:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HuseynNajafli](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@HuseynNajafli](https://community.dynatrace.com/u/HuseynNajafli)\
**Post date:** [August 6, 2025, 8:44am UTC](https://community.dynatrace.com/t/filter-only-active-hosts-processes-services-and-applications-using-entityselector/52824/1 "2025-08-06T08:44:04Z")

</div>

Hello.

I want to create a management zone for my Windows hosts which shows only active Windows hosts (there are connected Linux hosts, but&nbsp; I don’t want showing Linux hosts only Windows hosts), active processes, active services and active applications. How can I write an entitySelector for this task? And where I can find entitySelector syntax tutorial, examples or full documentation about entitySelector?

Regards,

Huseyn N.

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [August 6, 2025, 9:17am UTC](https://community.dynatrace.com/t/filter-only-active-hosts-processes-services-and-applications-using-entityselector/52824/2 "2025-08-06T09:17:38Z")

</div>

Hi,

I would say using automatic tagging rules for “mark” those hosts, processes, services, etc…

And later, create a management zone filtering by that tag.

Best regards

---

<div class="post-metadata">

**Author:** ![HuseynNajafli](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@HuseynNajafli](https://community.dynatrace.com/u/HuseynNajafli)\
**Post date:** [August 6, 2025, 10:31am UTC](https://community.dynatrace.com/t/filter-only-active-hosts-processes-services-and-applications-using-entityselector/52824/3 "2025-08-06T10:31:25Z")

</div>

I did it. I created a management zone but i didn’t apply filter to only active service, processes or hosts. I wrote these entitySelectors:

For Applications:

```markup
type("APPLICATION"),fromRelationship.calls(type("SERVICE"),fromRelationship.runsOnHost(type("HOST"),osType("WINDOWS")))

```

For Services:

```markup
type("SERVICE"),fromRelationship.runsOnHost(type("host"),osType("WINDOWS"))

```

For Processes:

```markup
type("PROCESS_GROUP_INSTANCE"),fromRelationships.isProcessOf(type("HOST"),osType("WINDOWS"))

```

For Hosts:

```markup
type("HOST"), osType("WINDOWS")

```

But these shows active and inactive everything. I want to show only active things.

How can I write entitySelector as I want?

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [August 6, 2025, 2:13pm UTC](https://community.dynatrace.com/t/filter-only-active-hosts-processes-services-and-applications-using-entityselector/52824/4 "2025-08-06T14:13:10Z")

</div>

[@HuseynNajafli](https://community.dynatrace.com/user/93912)You cannot select just active entities with entitySelector. Other APIs or functionality which uses Entity Selector does that. You can only filter on firstSeenTms, unfortunately, not on the lastSeenTms.

Docs for entity selector are here:&nbsp;[Environment API v2 - Entity selector — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/api-entities-v2-selector)
