# HostName lookup on timeseries process Grail query

**URL:** <https://community.dynatrace.com/t/hostname-lookup-on-timeseries-process-grail-query/46061>\
**Category:** DQL\
**Tags:** dql, hosts-classic, processes, infrastructure-operations\
**Created:** [June 11, 2024, 11:19pm UTC](https://community.dynatrace.com/t/hostname-lookup-on-timeseries-process-grail-query/46061 "2024-06-11T23:19:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DAVID\_JAUREGUI1](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@DAVID\_JAUREGUI1](https://community.dynatrace.com/u/DAVID_JAUREGUI1)\
**Post date:** [June 11, 2024, 11:19pm UTC](https://community.dynatrace.com/t/hostname-lookup-on-timeseries-process-grail-query/46061/1 "2024-06-11T23:19:48Z")

</div>

I have DQL timeseries process query that I want to lookup the host and add the hostname field to the displayed fields.&nbsp; The issue I’m having is identifying the source & lookup fields in the lookup function that would get me to the hostname for the host where the process is running.&nbsp; Is there an example you can provide of a similar DQL query?

Also is there any documentation that identifies the available fields for a given dt.entity… so that one can identify the entities & fields that will be required in order to lookup the field data to meet one’s requirements?

I tried using the “runs\_on” funciton below called out in Ex. 2 under the “Practical Examples” section in the lookup command doc found [here](https://docs.dynatrace.com/docs/shortlink/correlation-and-join-commands#lookup),&nbsp;but this does not seem to work with my timeseries process query.

```markup
fetch dt.entity.service_instance
| lookup [fetch dt.entity.host],
sourceField: runs_on[dt.entity.host],
lookupField: id,
fields: { host.name = entity.name }

```

---

<div class="post-metadata">

**Author:** ![PiotrG](https://avatars.discourse-cdn.com/v4/letter/p/e47774/32.png) [@PiotrG](https://community.dynatrace.com/u/PiotrG)\
**Post date:** [December 2, 2024, 10:37am UTC](https://community.dynatrace.com/t/hostname-lookup-on-timeseries-process-grail-query/46061/2 "2024-12-02T10:37:07Z")

</div>

Hey!  
For the purpose of finding out what fields are available for an entity type you can run a query like this

```markup
describe dt.entity.host

```

Regarding your specific use case with timeseries process query, you can always define additional fields in the **by:** &nbsp;option and actually the host name is already there. Auto-suggestions in notebooks will provide you available fields to split by.

Example query:

```markup
timeseries avg(dt.process.availability), by: { host.name, dt.entity.process_group_instance }

```

If it happens that the field you are looking for is not exposed directly as an option to split by, you can always use [entityAttr](https://docs.dynatrace.com/docs/shortlink/general-functions#entityAttr)&nbsp;function to add any attribute you want, for example:

```markup
timeseries avg(dt.process.availability), by: { dt.entity.process_group_instance, dt.entity.host }
| fieldsAdd osType=entityAttr(dt.entity.host, "osType")

```

(There is also an [entityName](https://docs.dynatrace.com/docs/shortlink/general-functions#entityName) function that works very similar but just for getting the name of an entity)

Hope that helps!  
EDIT: There is another way to&nbsp;identify the entities & fields that are available, [semantic dictionary](https://docs.dynatrace.com/docs/discover-dynatrace/references/semantic-dictionary/model/dt-entities) contains information about all relationships and fields avaiable on each entity.
