# how get hostname from dt.source\_entity and dt.entity.process\_group\_instance

**URL:** <https://community.dynatrace.com/t/how-get-hostname-from-dt-source-entity-and-dt-entity-process-group-instance/54696>\
**Category:** DQL\
**Tags:** dql, logs\
**Created:** [January 21, 2026, 2:35pm UTC](https://community.dynatrace.com/t/how-get-hostname-from-dt-source-entity-and-dt-entity-process-group-instance/54696 "2026-01-21T14:35:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gasperetta](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gasperetta](https://community.dynatrace.com/u/gasperetta)\
**Post date:** [January 21, 2026, 2:35pm UTC](https://community.dynatrace.com/t/how-get-hostname-from-dt-source-entity-and-dt-entity-process-group-instance/54696/1 "2026-01-21T14:35:56Z")

</div>

HI,&nbsp;I need to pull out the hostname associated with each process:

this is my query…

timeseries count = sum(dt.log.status\_per\_entity\_count, default: 0), by:{dt.source\_entity,dt.entity.process\_group,dt.entity.host}  
| filter isNotNull(dt.source\_entity)  
| filter matchesValue(dt.entity.process\_group,“\*PROCESS\*”)  
| expand dt.source\_entity  
| fieldsAdd dt.entity.process\_group  
| fieldsAdd dt.entity.host  
| fieldsAdd dt.source\_entity  
| fields dt.source\_entity, records = arraySum(count), joinMe = “\*”  
| sort records desc  
| limit 50  
//| join [fetch dt.entity.host], on: { left[dt.source\_entity] == right[id] }, kind:leftOuter, prefix: “host.”  
| join [fetch dt.entity.process\_group\_instance], on: { left[dt.source\_entity] == right[id] }, kind:leftOuter, prefix: “pgi.”

| join [  
timeseries total = sum(dt.log.status\_per\_entity\_count, default: 0)  
| fields total = arraySum(total), joinMe=“\*”  
], on: joinMe

| fields  
dt.source\_entity=toString(dt.source\_entity), percentage = (records / right.total) \* 100,  
name=coalesce(  
pgi.entity.name  
)

i need one more colunm whit hostane

 ![Screenshot 2026-01-21 153315.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/f/9fc8e82af5f130b3819a70b33afde23c1b5251b0.png)

---

<div class="post-metadata">

**Author:** ![raksh\_hitha](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@raksh\_hitha](https://community.dynatrace.com/u/raksh_hitha)\
**Post date:** [January 21, 2026, 10:54pm UTC](https://community.dynatrace.com/t/how-get-hostname-from-dt-source-entity-and-dt-entity-process-group-instance/54696/2 "2026-01-21T22:54:32Z")

</div>

Hi Gasperetta 🙂

Try this out!  
timeseries count = sum(dt.log.status\_per\_entity\_count, default: 0), by:{dt.source\_entity,dt.entity.process\_group,dt.entity.host}  
| filter isNotNull(dt.source\_entity)  
| filter matchesValue(dt.entity.process\_group,“\*PROCESS\*”)  
| expand dt.source\_entity  
| fieldsAdd dt.entity.process\_group  
| fieldsAdd dt.entity.host  
| fieldsAdd dt.source\_entity  
| fieldsAdd hostname = entityName(dt.entity.host)  
| fields dt.source\_entity, dt.entity.host, hostname, records = arraySum(count), joinMe = “\*”  
| sort records desc  
| limit 50  
| join [fetch dt.entity.process\_group\_instance], on: { left[dt.source\_entity] == right[id] }, kind:leftOuter, prefix: “pgi.”

| join [  
timeseries total = sum(dt.log.status\_per\_entity\_count, default: 0)  
| fields total = arraySum(total), joinMe=“\*”  
], on: joinMe

| fields  
dt.source\_entity=toString(dt.source\_entity), percentage = (records / right.total) \* 100,  
name=coalesce(pgi.entity.name), hostname, hostID = pgi.belongs\_to

 ![dql.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/4/b45df359b4cd3e73868ed69944637c23a58f0f36.png)

---

<div class="post-metadata">

**Author:** ![gasperetta](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gasperetta](https://community.dynatrace.com/u/gasperetta)\
**Post date:** [January 22, 2026, 8:27am UTC](https://community.dynatrace.com/t/how-get-hostname-from-dt-source-entity-and-dt-entity-process-group-instance/54696/3 "2026-01-22T08:27:49Z")

</div>

Thank you so much
