<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Find all host_groups with hosts that have a specific tag in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Find-all-host-groups-with-hosts-that-have-a-specific-tag/m-p/213782#M30</link>
    <description>&lt;DIV class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;
&lt;DIV class="c-message__message_blocks c-message__message_blocks--rich_text" data-qa="message-text"&gt;
&lt;DIV class="p-block_kit_renderer" data-qa="block-kit-renderer"&gt;
&lt;DIV class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;
&lt;DIV class="p-rich_text_block" dir="auto"&gt;
&lt;DIV class="p-rich_text_section"&gt;You need to join the 2 tables using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;lookup&lt;/CODE&gt;&amp;nbsp; and then do a filter. Please try following DQL:&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;fetch dt.entity.host_group&lt;BR /&gt;| lookup [fetch dt.entity.host&lt;BR /&gt;| filter matchesPhrase(tags,"MyTag")&lt;BR /&gt;| fieldsAdd hostGroupReference = instance_of[dt.entity.host_group]], sourceField:id, lookupField:hostGroupReference&lt;BR /&gt;| filter isNotNull(lookup.id)&lt;BR /&gt;| fieldsRemove "lookup*"&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="c-message_kit__reaction_bar c-reaction_bar c-reaction_bar--dark c-reaction_bar--collapsed" role="group" data-qa="reaction_bar" aria-label="Reactions" data-stringify-ignore="true"&gt;Some explanation&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI class="c-message_kit__reaction_bar c-reaction_bar c-reaction_bar--dark c-reaction_bar--collapsed" role="group" data-qa="reaction_bar" aria-label="Reactions" data-stringify-ignore="true"&gt;first fetch all host groups&lt;/LI&gt;
&lt;LI class="c-message_kit__reaction_bar c-reaction_bar c-reaction_bar--dark c-reaction_bar--collapsed" role="group" data-qa="reaction_bar" aria-label="Reactions" data-stringify-ignore="true"&gt;then do a lookup for hosts filtered by the tag.&amp;nbsp;&lt;/LI&gt;
&lt;LI class="c-message_kit__reaction_bar c-reaction_bar c-reaction_bar--dark c-reaction_bar--collapsed" role="group" data-qa="reaction_bar" aria-label="Reactions" data-stringify-ignore="true"&gt;hosts are linked to the host groups by the field&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;instance_of[dt.entity.host_group]&lt;/CODE&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI class="c-message_kit__reaction_bar c-reaction_bar c-reaction_bar--dark c-reaction_bar--collapsed" role="group" data-qa="reaction_bar" aria-label="Reactions" data-stringify-ignore="true"&gt;then filter on hosts groups which have the field&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;lookup.id&lt;/CODE&gt;&amp;nbsp;. Basically filter only those host groups which have match from the lookup&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Mon, 19 Jun 2023 09:27:21 GMT</pubDate>
    <dc:creator>stefan_eggersto</dc:creator>
    <dc:date>2023-06-19T09:27:21Z</dc:date>
    <item>
      <title>Find all host_groups with hosts that have a specific tag</title>
      <link>https://community.dynatrace.com/t5/DQL/Find-all-host-groups-with-hosts-that-have-a-specific-tag/m-p/213673#M10</link>
      <description>&lt;DIV class="p-rich_text_section"&gt;Hi there,&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;How would one find all host_groups with hosts that have a specific tag? Something like:&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;fetch dt.entity.host_group
| filter in(id,[fetch dt.entity.host |filter matchesValue(tags,"MyTag")|fields id])&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;I still struggle a bit with DQL syntax…&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Do I need a FilterIn, a Lookup, etc?&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;Best,&lt;BR /&gt;Sini&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 31 May 2023 14:03:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Find-all-host-groups-with-hosts-that-have-a-specific-tag/m-p/213673#M10</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-05-31T14:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Find all host_groups with hosts that have a specific tag</title>
      <link>https://community.dynatrace.com/t5/DQL/Find-all-host-groups-with-hosts-that-have-a-specific-tag/m-p/213782#M30</link>
      <description>&lt;DIV class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;
&lt;DIV class="c-message__message_blocks c-message__message_blocks--rich_text" data-qa="message-text"&gt;
&lt;DIV class="p-block_kit_renderer" data-qa="block-kit-renderer"&gt;
&lt;DIV class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;
&lt;DIV class="p-rich_text_block" dir="auto"&gt;
&lt;DIV class="p-rich_text_section"&gt;You need to join the 2 tables using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;lookup&lt;/CODE&gt;&amp;nbsp; and then do a filter. Please try following DQL:&lt;/DIV&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;fetch dt.entity.host_group&lt;BR /&gt;| lookup [fetch dt.entity.host&lt;BR /&gt;| filter matchesPhrase(tags,"MyTag")&lt;BR /&gt;| fieldsAdd hostGroupReference = instance_of[dt.entity.host_group]], sourceField:id, lookupField:hostGroupReference&lt;BR /&gt;| filter isNotNull(lookup.id)&lt;BR /&gt;| fieldsRemove "lookup*"&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="c-message_kit__reaction_bar c-reaction_bar c-reaction_bar--dark c-reaction_bar--collapsed" role="group" data-qa="reaction_bar" aria-label="Reactions" data-stringify-ignore="true"&gt;Some explanation&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI class="c-message_kit__reaction_bar c-reaction_bar c-reaction_bar--dark c-reaction_bar--collapsed" role="group" data-qa="reaction_bar" aria-label="Reactions" data-stringify-ignore="true"&gt;first fetch all host groups&lt;/LI&gt;
&lt;LI class="c-message_kit__reaction_bar c-reaction_bar c-reaction_bar--dark c-reaction_bar--collapsed" role="group" data-qa="reaction_bar" aria-label="Reactions" data-stringify-ignore="true"&gt;then do a lookup for hosts filtered by the tag.&amp;nbsp;&lt;/LI&gt;
&lt;LI class="c-message_kit__reaction_bar c-reaction_bar c-reaction_bar--dark c-reaction_bar--collapsed" role="group" data-qa="reaction_bar" aria-label="Reactions" data-stringify-ignore="true"&gt;hosts are linked to the host groups by the field&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;instance_of[dt.entity.host_group]&lt;/CODE&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI class="c-message_kit__reaction_bar c-reaction_bar c-reaction_bar--dark c-reaction_bar--collapsed" role="group" data-qa="reaction_bar" aria-label="Reactions" data-stringify-ignore="true"&gt;then filter on hosts groups which have the field&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;lookup.id&lt;/CODE&gt;&amp;nbsp;. Basically filter only those host groups which have match from the lookup&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 19 Jun 2023 09:27:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Find-all-host-groups-with-hosts-that-have-a-specific-tag/m-p/213782#M30</guid>
      <dc:creator>stefan_eggersto</dc:creator>
      <dc:date>2023-06-19T09:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Find all host_groups with hosts that have a specific tag</title>
      <link>https://community.dynatrace.com/t5/DQL/Find-all-host-groups-with-hosts-that-have-a-specific-tag/m-p/254971#M1177</link>
      <description>&lt;P&gt;How would one go about this using timeseries data? Same thing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e. I have a query for disk space by a single host filter that works, but i want to leverage Host Group rather than dt.entity.host for my filter value.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 19:44:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Find-all-host-groups-with-hosts-that-have-a-specific-tag/m-p/254971#M1177</guid>
      <dc:creator>SGOconnell1</dc:creator>
      <dc:date>2024-09-04T19:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Find all host_groups with hosts that have a specific tag</title>
      <link>https://community.dynatrace.com/t5/DQL/Find-all-host-groups-with-hosts-that-have-a-specific-tag/m-p/255053#M1179</link>
      <description>&lt;P&gt;Even simpler then it was possible 1 year ago. E.g. to get disk usage for all disks of hosts in specific host group:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries disk_used=max(dt.host.disk.used), 
  by:{dt.entity.host, dt.entity.disk}, 
  filter: {entityName(dt.entity.host_group)=="vmware"}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1725561757501.png" style="width: 850px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22220i1A8C84738FED8DFB/image-dimensions/850x274?v=v2" width="850" height="274" role="button" title="krzysztof_hoja_0-1725561757501.png" alt="krzysztof_hoja_0-1725561757501.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 18:43:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Find-all-host-groups-with-hosts-that-have-a-specific-tag/m-p/255053#M1179</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-09-05T18:43:25Z</dc:date>
    </item>
  </channel>
</rss>

