<?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: Converting DQL into timeseries in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256434#M1222</link>
    <description>&lt;P&gt;No, if you take a look at summarize command, there we are trying to collect distinct userIds and all other fields are under "by" section, can we do the same with&amp;nbsp;&lt;STRONG&gt;makeTimeseries&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;summarize requestId = collectDistinct(user_id),by:{bin(timestamp,1m), log, userid_generated, userid_is_not_NULL, user_type}&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 19 Sep 2024 06:39:25 GMT</pubDate>
    <dc:creator>AK</dc:creator>
    <dc:date>2024-09-19T06:39:25Z</dc:date>
    <item>
      <title>Converting DQL into timeseries</title>
      <link>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256156#M1218</link>
      <description>&lt;P&gt;Hello Folks,&lt;/P&gt;&lt;P&gt;Need some help in converting following query into timeseries as I wanted to use it in Davis anomaly detection.&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch logs, from:now() - 4h
| filter contains(dt.process.name, "process_name")
| filter contains (content, "Error when user:")
| parse content, "JSON:json"
| parse json[log],  "LD ': ' LD:user_id ' - ' LD ': ' BOOL:userid_generated LD ': ' BOOL:userid_is_not_NULL"
| fields timestamp, log = json[log], user_id, userid_generated, userid_is_not_NULL, user_type = json[`user-type`]
| summarize requestId = collectDistinct(user_id), by:{bin(timestamp,1m), log, userid_generated, userid_is_not_NULL, user_type}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;AK&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 19:20:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256156#M1218</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2024-09-17T19:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Converting DQL into timeseries</title>
      <link>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256163#M1219</link>
      <description>&lt;P&gt;Hi AK,&lt;/P&gt;&lt;P&gt;I would look at using the makeTimeseries command instead of summarize as documented here&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/shortlink/aggregation-commands#makeTimeseries" target="_blank"&gt;https://docs.dynatrace.com/docs/shortlink/aggregation-commands#makeTimeseries&lt;/A&gt;. The third example on that page would likely be the best fit for you. It would probably look something like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch logs, from:now() - 4h
| filter contains(dt.process.name, "process_name")
| filter contains (content, "Error when user:")
| parse content, "JSON:json"
| parse json[log],  "LD ': ' LD:user_id ' - ' LD ': ' BOOL:userid_generated LD ': ' BOOL:userid_is_not_NULL"
| fields timestamp, log = json[log], user_id, userid_generated, userid_is_not_NULL, user_type = json[`user-type`]
| makeTimeseries count(), by:{log, userid_generated, userid_is_not_NULL, user_type}&lt;/LI-CODE&gt;&lt;P&gt;I would however recommend first turning it into a metric on ingest so that you aren't constantly querying logs for anomaly detection. This would also allow you to reuse the metric on dashboards or in notebooks more easily as well. Docs for that can be found here:&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/platform/openpipeline/use-cases/tutorial-log-processing-pipeline" target="_blank"&gt;https://docs.dynatrace.com/docs/platform/openpipeline/use-cases/tutorial-log-processing-pipeline&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 22:28:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256163#M1219</guid>
      <dc:creator>Fin_Ubels</dc:creator>
      <dc:date>2024-09-17T22:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Converting DQL into timeseries</title>
      <link>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256332#M1220</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/56028"&gt;@Fin&lt;/a&gt;, thank you for the query, its working fine.&lt;/P&gt;&lt;P&gt;Is it possible to use collectDistinct to collect distinct values of&amp;nbsp;&lt;STRONG&gt;user_id &lt;/STRONG&gt;under &lt;STRONG&gt;makeTimeseries&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;AK&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 15:14:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256332#M1220</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2024-09-18T15:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Converting DQL into timeseries</title>
      <link>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256407#M1221</link>
      <description>&lt;P&gt;Good to hear!&lt;BR /&gt;If you want user_id to be one of the dimensions, then you would include it in the by:{} section. Is that what you're looking for?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 23:40:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256407#M1221</guid>
      <dc:creator>Fin_Ubels</dc:creator>
      <dc:date>2024-09-18T23:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Converting DQL into timeseries</title>
      <link>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256434#M1222</link>
      <description>&lt;P&gt;No, if you take a look at summarize command, there we are trying to collect distinct userIds and all other fields are under "by" section, can we do the same with&amp;nbsp;&lt;STRONG&gt;makeTimeseries&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;summarize requestId = collectDistinct(user_id),by:{bin(timestamp,1m), log, userid_generated, userid_is_not_NULL, user_type}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Sep 2024 06:39:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256434#M1222</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2024-09-19T06:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Converting DQL into timeseries</title>
      <link>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256494#M1223</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;makeTimeseries&lt;/STRONG&gt; &lt;/EM&gt;command produces arrays of numbers (track changes of metric value over time), so it will not work with &lt;EM&gt;&lt;STRONG&gt;collectDistinct&lt;/STRONG&gt;&lt;/EM&gt; as it produces array of unique user_id values.&lt;BR /&gt;What would make sense to have metric "number of unique user_id values" over time. Then you should use&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;countDistinctExact&lt;/STRONG&gt;&lt;/EM&gt; or&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;countDistinctApprox&lt;/STRONG&gt;&lt;/EM&gt; function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kris&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 14:27:08 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Converting-DQL-into-timeseries/m-p/256494#M1223</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-09-19T14:27:08Z</dc:date>
    </item>
  </channel>
</rss>

