I have the following DQL query in my dashboard:
fetch dt.entity.host
| fields entity.name, runs
| fieldsFlatten runs
| filter in(runs.dt.entity.service, $services)
| fields entity.name, runs.dt.entity.service
The $services variable returns a list of service IDs, i.e “SERVICE-C1917273162D91”.
I would like the query to return a table of hosts and their corresponding services, using hostnames and service names. Here is an example of what I’m trying to achieve:
| hostname | service |
|---|---|
| server-01 | myservice, anotherservice, yetanotherservice |
| server-02 | myservice |
| server-03 | anotherservice, yetanotherotherservice |
But the actual result I get is:
| entity.name | runs.dt.entity.service |
|---|---|
| server-01 | SERVICE-C912138912D19, SERVICE-C1298314717J89, SERVICE-G821398124921B90 |
| server-02 | SERVICE-C1298314717J89 |
| server-03 | SERVICE-C1298314717J89, SERVICE-G821398124921B90 |
I have tried using the “lookup” function, but did not have any luck.
fetch dt.entity.service
| filter in(id, runs.dt.entity.host)
], lookupField:id, sourceField:runs.dt.entity.host
How can I display the name of the service in this table instead, whilst keeping the relationship between the host and its services?
Thanks in advance

