# DQL to get process group for specific set of hosts

**URL:** <https://community.dynatrace.com/t/dql-to-get-process-group-for-specific-set-of-hosts/44729>\
**Category:** DQL\
**Tags:** dql, notebooks\
**Created:** [March 18, 2024, 4:49pm UTC](https://community.dynatrace.com/t/dql-to-get-process-group-for-specific-set-of-hosts/44729 "2024-03-18T16:49:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [March 18, 2024, 4:49pm UTC](https://community.dynatrace.com/t/dql-to-get-process-group-for-specific-set-of-hosts/44729/1 "2024-03-18T16:49:06Z")

</div>

I need help to get&nbsp;process group for specific set of hosts using DQL.

Has anyone extracted it successfully?

Regards,

AK

---

<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:** [March 18, 2024, 6:45pm UTC](https://community.dynatrace.com/t/dql-to-get-process-group-for-specific-set-of-hosts/44729/2 "2024-03-18T18:45:51Z")

</div>

Hi,

It returns all process groups IDs and visual name for host “XXXX”:

```markup
fetch dt.entity.host
| filter entity.name == "XXXX"
| expand runs[dt.entity.process_group]
| fieldsAdd process_group.name = lookup(
    [fetch dt.entity.process_group], lookupField:id, sourceField:`runs[dt.entity.process_group]`
  )[entity.name]

```

Maybe a better DQL query can be done.

Best regards

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [March 18, 2024, 8:29pm UTC](https://community.dynatrace.com/t/dql-to-get-process-group-for-specific-set-of-hosts/44729/3 "2024-03-18T20:29:11Z")

</div>

As single process group can run on multiple hosts, this query may contain duplicates, you can use _ **dedup** _ command

```markup
| dedup `runs[dt.entity.process_group]`, process_group.name

```

to get list of unique process group ids/names and one exemplary host id/name for each of them. Alternatively you can use _ **summarize** _ to get unique process group ids/names with array of hosts it runs on

```markup
| summarize {ids=collectDistinct(id)}, by: {`runs[dt.entity.process_group]`, process_group.name}

```

Kris

---

<div class="post-metadata">

**Author:** ![DineshP](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@DineshP](https://community.dynatrace.com/u/DineshP)\
**Post date:** [February 16, 2025, 4:21pm UTC](https://community.dynatrace.com/t/dql-to-get-process-group-for-specific-set-of-hosts/44729/4 "2025-02-16T16:21:06Z")

</div>

Hi&nbsp;[@krzysztof\_hoja](https://community.dynatrace.com/user/25373)&nbsp;/&nbsp;[@AntonPineiro](https://community.dynatrace.com/user/58682)

Good Day!

I am trying to fetch the software technologies of the process group. Could you please help me achieve this?

Thanks!

 ![QA.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/c/4c44212ee68026c9979d41d05d539da977ce4da1.png)

---

<div class="post-metadata">

**Author:** ![gdalessandro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gdalessandro/32/5318_2.png) [@gdalessandro](https://community.dynatrace.com/u/gdalessandro)\
**Post date:** [April 1, 2025, 7:45pm UTC](https://community.dynatrace.com/t/dql-to-get-process-group-for-specific-set-of-hosts/44729/5 "2025-04-01T19:45:08Z")

</div>

I used this query to successfully get a list of processes that have a specific one agent version installed on them.

fetch dt.entity.process\_group\_instance&nbsp;  
| fieldsadd&nbsp;&nbsp; host\_id=belongs\_to[dt.entity.host]  
|join[fetch dt.entity.host | filter contains(installerVersion, “1.307”) | fieldsAdd installerVersion], on:left[host\_id] == right[id]

I would think that something like this should give you what you are after:

fetch dt.entity.process\_group\_instance&nbsp;  
| fieldsadd&nbsp;&nbsp; host\_id=belongs\_to[dt.entity.host]  
|join[fetch dt.entity.host | filter dt.entity.host in (host1, host2,hoste)], on:left[host\_id] == right[id]
