<?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 Querying CPU Comparison with Custom Tags in DQL in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Querying-CPU-Comparison-with-Custom-Tags-in-DQL/m-p/257797#M1277</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I am new to the DQL language and I would like to ask if it is possible to make a CPU comparison with the average of all hosts entities that are included by several tags.&lt;/P&gt;
&lt;P&gt;Let me explain, I have this query that gives me the average CPU usage of all the hosts that match the filter tags:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;timeseries usage = avg(dt.host.cpu.usage), &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;filter: { in(dt.entity.host, classicEntitySelector(“type(host),tag(\”APP:FAKE_APP")}&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the other hand I have this other query that compares me the CPU consumption of the hosts that match the host.name:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;timeseries cpu=avg(dt.host.cpu.usage), &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;by:{host.name},&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;from: -30d&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| append [timeseries cpu.30d=avg(dt.host.cpu.usage), by:{host.name}, shift:-30d]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| filter startsWith(host.name, “FAKE_HOST”).&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is if they can be somehow linked so that the filter uses custom tags instead of host.name.&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;</description>
    <pubDate>Thu, 03 Oct 2024 06:31:06 GMT</pubDate>
    <dc:creator>VictorRuiz</dc:creator>
    <dc:date>2024-10-03T06:31:06Z</dc:date>
    <item>
      <title>Querying CPU Comparison with Custom Tags in DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Querying-CPU-Comparison-with-Custom-Tags-in-DQL/m-p/257797#M1277</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I am new to the DQL language and I would like to ask if it is possible to make a CPU comparison with the average of all hosts entities that are included by several tags.&lt;/P&gt;
&lt;P&gt;Let me explain, I have this query that gives me the average CPU usage of all the hosts that match the filter tags:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;timeseries usage = avg(dt.host.cpu.usage), &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;filter: { in(dt.entity.host, classicEntitySelector(“type(host),tag(\”APP:FAKE_APP")}&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the other hand I have this other query that compares me the CPU consumption of the hosts that match the host.name:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;timeseries cpu=avg(dt.host.cpu.usage), &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;by:{host.name},&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;from: -30d&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| append [timeseries cpu.30d=avg(dt.host.cpu.usage), by:{host.name}, shift:-30d]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| filter startsWith(host.name, “FAKE_HOST”).&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is if they can be somehow linked so that the filter uses custom tags instead of host.name.&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 06:31:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Querying-CPU-Comparison-with-Custom-Tags-in-DQL/m-p/257797#M1277</guid>
      <dc:creator>VictorRuiz</dc:creator>
      <dc:date>2024-10-03T06:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Querying CPU Comparison with Custom Tags in DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Querying-CPU-Comparison-with-Custom-Tags-in-DQL/m-p/258018#M1286</link>
      <description>&lt;P&gt;I am not sure if i captured the need correctly, but here is my example: comparison of individual host CPU usage (only hosts with given tags) and average CPU usage of all hosts for earlier period of time.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries avg(dt.host.cpu.usage), by: {dt.entity.host}, filter:{ in(dt.entity.host, classicEntitySelector("type(host),tag(Azure:VM)")) }
| append [

  timeseries avg(dt.host.cpu.usage), shift: -7d
  , filter:{ in(dt.entity.host, classicEntitySelector("type(host),tag(Azure:VM)")) }
  
  | fieldsAdd dt.entity.host = "Reference"
  
]&lt;/LI-CODE&gt;&lt;P&gt;Result looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1727966312156.png" style="width: 855px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/23178i5141704B2F65534F/image-dimensions/855x359?v=v2" width="855" height="359" role="button" title="krzysztof_hoja_0-1727966312156.png" alt="krzysztof_hoja_0-1727966312156.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 14:39:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Querying-CPU-Comparison-with-Custom-Tags-in-DQL/m-p/258018#M1286</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-10-03T14:39:36Z</dc:date>
    </item>
  </channel>
</rss>

