<?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 convert DQL log  query to timeseries in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/convert-DQL-log-query-to-timeseries/m-p/242310#M807</link>
    <description>&lt;P&gt;So far I have the following DQL query that works:&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;```&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;fetch logs&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;| filter dt.entity.kubernetes_cluster == "KUBERNETES_CLUSTER-ABCDEFG" or in(dt.entity.kubernetes_cluster, "KUBERNETES_CLUSTER-ABCDEFG")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;| summarize total = count(), errTotal = countIf(status == "ERROR")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;| fieldsAdd errPercent = (toDouble(errTotal)*100 / total)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;```&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Is it possible to convert this to a timeseries using makeTimeSeries, such that this can be graphed over time or converted to a metric that we can alert on?&amp;nbsp; So far I can't quite get the syntax right for `makeTimeSeries`.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2024 12:11:48 GMT</pubDate>
    <dc:creator>roberto_camp1</dc:creator>
    <dc:date>2024-04-10T12:11:48Z</dc:date>
    <item>
      <title>convert DQL log  query to timeseries</title>
      <link>https://community.dynatrace.com/t5/DQL/convert-DQL-log-query-to-timeseries/m-p/242310#M807</link>
      <description>&lt;P&gt;So far I have the following DQL query that works:&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;```&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;fetch logs&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;| filter dt.entity.kubernetes_cluster == "KUBERNETES_CLUSTER-ABCDEFG" or in(dt.entity.kubernetes_cluster, "KUBERNETES_CLUSTER-ABCDEFG")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;| summarize total = count(), errTotal = countIf(status == "ERROR")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;| fieldsAdd errPercent = (toDouble(errTotal)*100 / total)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;```&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Is it possible to convert this to a timeseries using makeTimeSeries, such that this can be graphed over time or converted to a metric that we can alert on?&amp;nbsp; So far I can't quite get the syntax right for `makeTimeSeries`.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 12:11:48 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/convert-DQL-log-query-to-timeseries/m-p/242310#M807</guid>
      <dc:creator>roberto_camp1</dc:creator>
      <dc:date>2024-04-10T12:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: convert DQL log  query to timeseries</title>
      <link>https://community.dynatrace.com/t5/DQL/convert-DQL-log-query-to-timeseries/m-p/242320#M808</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/67600"&gt;@roberto_camp1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create a timeseries from your query you cannot use the "&lt;SPAN&gt;summarize&lt;/SPAN&gt;" command, because then you create a summary from all the data that the query returned in the form of a single record.&lt;/P&gt;&lt;P&gt;It is possible to create a timeseries that, for example, draws the number of logs with ERROR status versus the number of all logs, in your case:&lt;/P&gt;&lt;P&gt;fetch logs&lt;/P&gt;&lt;P&gt;| filter dt.entity.kubernetes_cluster == "KUBERNETES_CLUSTER-ABCDEFG" or in(dt.entity.kubernetes_cluster, "KUBERNETES_CLUSTER-ABCDEFG")&lt;/P&gt;&lt;P&gt;| makeTimeseries error_logs = countIf(loglevel == "ERROR"), all_logs = count()&lt;BR /&gt;&lt;BR /&gt;Bests&lt;BR /&gt;Michal&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 13:50:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/convert-DQL-log-query-to-timeseries/m-p/242320#M808</guid>
      <dc:creator>MichalOlszewski</dc:creator>
      <dc:date>2024-04-10T13:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: convert DQL log  query to timeseries</title>
      <link>https://community.dynatrace.com/t5/DQL/convert-DQL-log-query-to-timeseries/m-p/242332#M809</link>
      <description>&lt;P&gt;That works for coverting my basic query into timeSeries, so thank you, but my requirement remains to observe the % of error log messsages over time.&amp;nbsp; I have tried to add that to your solution but getting errrors:&lt;/P&gt;&lt;P&gt;,,,&lt;/P&gt;&lt;P&gt;fetch logs&lt;/P&gt;&lt;P&gt;| filter dt.entity.kubernetes_cluster == "KUBERNETES_CLUSTER-763AC7E6FD9C1ED1" or in(dt.entity.kubernetes_cluster, "KUBERNETES_CLUSTER-763AC7E6FD9C1ED1")&lt;/P&gt;&lt;P&gt;| makeTimeseries error_logs = countIf(loglevel == "ERROR"), all_logs = count(), errPercent = (toDouble(error_logs)*100 / all_logs)&lt;/P&gt;&lt;P&gt;'''&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;ERR MSG: "Mandatory parameter has to be.&lt;/SPAN&gt;&lt;SPAN&gt;The parameter has to be an expression-based timeseries aggregation."&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 15:23:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/convert-DQL-log-query-to-timeseries/m-p/242332#M809</guid>
      <dc:creator>roberto_camp1</dc:creator>
      <dc:date>2024-04-10T15:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: convert DQL log  query to timeseries</title>
      <link>https://community.dynatrace.com/t5/DQL/convert-DQL-log-query-to-timeseries/m-p/242354#M812</link>
      <description>&lt;P&gt;You need to calculate percentage as a additional step:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fieldsAdd errPercent = 100*toDouble(error_logs[]) / all_logs[]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 18:30:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/convert-DQL-log-query-to-timeseries/m-p/242354#M812</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-04-10T18:30:36Z</dc:date>
    </item>
  </channel>
</rss>

