11 Jun 2025 02:27 PM
I'm trying to gather all the hosts but only this specific environment. What would be a good DQL for that?
11 Jun 2025 03:00 PM
What do you mean by environment? Are you referring to a specific Management Zone or Segment, or something else?
If you just looking to collect all hosts in your entire Dynatrace tenant you can run "fetch dt.entity.host" and it will return all hosts with the default fields of "entity.name" and "id".
11 Jun 2025 07:10 PM
I'm not entirely sure of the specific field or attribute you're looking for when you say "Environment", but my organization embeds the environment name in the host group name, so you can try to filter on the "hostGroupName" field. You can also try to filter on tags in case the value you're looking for is included in the tags.
fetch dt.entity.host
| fieldsAdd hostGroupName, tags
// you can filter for the "environment" like so:
| filter contains(tags, "YOUR_ENV", caseSensitive:false)