<?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: DQL Fetch Logs Averages in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/DQL-Fetch-Logs-Averages/m-p/254628#M1159</link>
    <description>&lt;P&gt;If I understand the need correctly, first you need to calculate counts per day. This can be done this way:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch logs
| summarize cnt=count(), by:{status, timestamp=bin(timestamp,1d,at:-2h) }&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1725051122575.png" style="width: 753px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22134i9DF42227974C65FA/image-dimensions/753x685?v=v2" width="753" height="685" role="button" title="krzysztof_hoja_0-1725051122575.png" alt="krzysztof_hoja_0-1725051122575.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the next step you need to average daily counts:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch logs
| summarize cnt=count(), by:{status, timestamp=bin(timestamp,1d,at:-2h) }
| summarize cnt=avg(cnt), by: {status}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_1-1725051225544.png" style="width: 798px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22135i451675C035FF965C/image-dimensions/798x381?v=v2" width="798" height="381" role="button" title="krzysztof_hoja_1-1725051225544.png" alt="krzysztof_hoja_1-1725051225544.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;notes: I used column &lt;EM&gt;status&lt;/EM&gt;, I do not have &lt;EM&gt;stauscode ;&amp;nbsp;&lt;/EM&gt;I used &lt;STRONG&gt;&lt;EM&gt;samplingRatio&lt;/EM&gt;&lt;/STRONG&gt; parameter in my queries to speed up their execution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2024 20:57:18 GMT</pubDate>
    <dc:creator>krzysztof_hoja</dc:creator>
    <dc:date>2024-08-30T20:57:18Z</dc:date>
    <item>
      <title>DQL Fetch Logs Averages</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-Fetch-Logs-Averages/m-p/254508#M1153</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am currently trying to write some dql which will provide some graphical data from the fetch logs command.&lt;/P&gt;&lt;P&gt;This is the fetch logs command I have so far below.&amp;nbsp; I need to average the results by 1day and 7days, whist also showing the status code field&lt;/P&gt;&lt;P&gt;fetch logs&lt;BR /&gt;| filter application =="myapp" or application == "mayapp2"&lt;BR /&gt;| filter sourcecontext == "source"&lt;BR /&gt;| filter requestpath == "limits/daily"&lt;/P&gt;&lt;P&gt;| summarize count(), by:{statuscode}&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 13:58:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-Fetch-Logs-Averages/m-p/254508#M1153</guid>
      <dc:creator>Gib80</dc:creator>
      <dc:date>2024-08-29T13:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: DQL Fetch Logs Averages</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-Fetch-Logs-Averages/m-p/254628#M1159</link>
      <description>&lt;P&gt;If I understand the need correctly, first you need to calculate counts per day. This can be done this way:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch logs
| summarize cnt=count(), by:{status, timestamp=bin(timestamp,1d,at:-2h) }&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1725051122575.png" style="width: 753px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22134i9DF42227974C65FA/image-dimensions/753x685?v=v2" width="753" height="685" role="button" title="krzysztof_hoja_0-1725051122575.png" alt="krzysztof_hoja_0-1725051122575.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the next step you need to average daily counts:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch logs
| summarize cnt=count(), by:{status, timestamp=bin(timestamp,1d,at:-2h) }
| summarize cnt=avg(cnt), by: {status}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_1-1725051225544.png" style="width: 798px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22135i451675C035FF965C/image-dimensions/798x381?v=v2" width="798" height="381" role="button" title="krzysztof_hoja_1-1725051225544.png" alt="krzysztof_hoja_1-1725051225544.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;notes: I used column &lt;EM&gt;status&lt;/EM&gt;, I do not have &lt;EM&gt;stauscode ;&amp;nbsp;&lt;/EM&gt;I used &lt;STRONG&gt;&lt;EM&gt;samplingRatio&lt;/EM&gt;&lt;/STRONG&gt; parameter in my queries to speed up their execution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 20:57:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-Fetch-Logs-Averages/m-p/254628#M1159</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-08-30T20:57:18Z</dc:date>
    </item>
  </channel>
</rss>

