<?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: Pro-Tip: DQL Query Snippets Collection in Dynatrace tips</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/270741#M1679</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Split timeseries data into one record per interval (useful for data export)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Metric data sometimes needs to be displayed as one row per time interval for use in tables or for export to other systems. Dynatrace's native format for timeseries events can complicate this process because the data values for the entire timeframe of a given timeseries are represented as an array within a single record.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_irmer_0-1740177574203.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26591i58AF071AE248A975/image-size/large?v=v2&amp;amp;px=999" role="button" title="marco_irmer_0-1740177574203.png" alt="marco_irmer_0-1740177574203.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;We can overcome this challenge by using an iterative expression and applying some transformations to generate a separate record for each discrete interval. This data can then be shown in table format, or exported to CSV, where each row contains a single interval and its data value(s).&lt;/P&gt;&lt;P&gt;DQL Query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;timeseries value = sum(dt.service.request.count), interval: 1h

// *** timeseries interval splitter start ***
| fields  interval=record(
          timeframe.start = timeframe[start] + interval * iIndex(),
          value[]
          /* add any dimension split (by:) field names here */
          )
| expand interval
| fieldsFlatten interval
| fieldsRemove interval
// *** timeseries interval splitter end ***&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query Output:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_irmer_1-1740177978262.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26592i98F4033B836EAF17/image-size/large?v=v2&amp;amp;px=999" role="button" title="marco_irmer_1-1740177978262.png" alt="marco_irmer_1-1740177978262.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Feb 2025 22:53:10 GMT</pubDate>
    <dc:creator>marco_irmer</dc:creator>
    <dc:date>2025-02-21T22:53:10Z</dc:date>
    <item>
      <title>Pro-Tip: DQL Query Snippets Collection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/255109#M1676</link>
      <description>&lt;P&gt;I started to collect various useful DQL query snippets to make it easier for users to get started with DQL. Internally I did this on a notebook, but I also wanted to share this with the community and lete everybody contribute their snippets as well. So why not on an ongoing thread here.&lt;/P&gt;&lt;P&gt;One reply for each snippet and use case, with a little description and a screenshot.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 07:22:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/255109#M1676</guid>
      <dc:creator>r_weber</dc:creator>
      <dc:date>2024-09-06T07:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Pro-Tip: DQL Query Snippets Collection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/255112#M1677</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Honeycomb representation of specific service's health status&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This code snippet creates a honeycomb visualization (like we had on old dashboards) of the service health status. It uses a) the service entity information and the existing davis problem events and combines them. You can filter services by tags (e.g. a dt.owner tag).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="r_weber_0-1725607634976.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22232i47AAC5FEFE807DCB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="r_weber_0-1725607634976.png" alt="r_weber_0-1725607634976.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To get red/green status indicators, set the color mapping in the honeycomb visualization:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="r_weber_1-1725607962464.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22233i6CA84A36AD16CB47/image-size/medium?v=v2&amp;amp;px=400" role="button" title="r_weber_1-1725607962464.png" alt="r_weber_1-1725607962464.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DQL Query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;fetch dt.entity.service, from: -30m
| filter arrayIndexOf(entityAttr(type:"dt.entity.service",id, "tags"),"dt.owner:purchase") &amp;gt; -1 
| join [ fetch dt.davis.events
         | filter arrayIndexOf(affected_entity_types,"dt.entity.service") &amp;gt; -1
         | filter event.status != "CLOSED"
         | expand affected_entity_ids
         | fieldsKeep event.status, affected_entity_ids
         | summarize affected_entity_id=takeFirst(affected_entity_ids), by: {event.status, affected_entity_ids}
       ],
       kind:leftOuter,
       on: left[id] == right[affected_entity_id]
| fieldsAdd health=if(isNull(right.event.status),"OK",else: "NOT OK")
| fieldsRename service=entity.name
| fieldsKeep service,id,health
| sort service asc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 07:33:23 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/255112#M1677</guid>
      <dc:creator>r_weber</dc:creator>
      <dc:date>2024-09-06T07:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Pro-Tip: DQL Query Snippets Collection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/255360#M1678</link>
      <description>&lt;H4&gt;Running operations in DQL with several metrics&lt;BR /&gt;&lt;BR /&gt;&lt;/H4&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="samgarkali_0-1725985511937.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/22288i5D41D8E33463C426/image-size/medium?v=v2&amp;amp;px=400" role="button" title="samgarkali_0-1725985511937.png" alt="samgarkali_0-1725985511937.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;timeseries {
  {used=avg(dt.host.memory.used)},
  {available=avg(dt.host.memory.avail.bytes)}
}, by:{dt.entity.host}
| fieldsAdd total = (used[] + available[])
| fieldsAdd used_percentage = (used[] / total[] * 100)
| fieldsRemove used, available, total&lt;/LI-CODE&gt;&lt;H4&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/H4&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 16:26:22 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/255360#M1678</guid>
      <dc:creator>samgar-kali</dc:creator>
      <dc:date>2024-09-10T16:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pro-Tip: DQL Query Snippets Collection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/270741#M1679</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Split timeseries data into one record per interval (useful for data export)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Metric data sometimes needs to be displayed as one row per time interval for use in tables or for export to other systems. Dynatrace's native format for timeseries events can complicate this process because the data values for the entire timeframe of a given timeseries are represented as an array within a single record.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_irmer_0-1740177574203.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26591i58AF071AE248A975/image-size/large?v=v2&amp;amp;px=999" role="button" title="marco_irmer_0-1740177574203.png" alt="marco_irmer_0-1740177574203.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;We can overcome this challenge by using an iterative expression and applying some transformations to generate a separate record for each discrete interval. This data can then be shown in table format, or exported to CSV, where each row contains a single interval and its data value(s).&lt;/P&gt;&lt;P&gt;DQL Query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;timeseries value = sum(dt.service.request.count), interval: 1h

// *** timeseries interval splitter start ***
| fields  interval=record(
          timeframe.start = timeframe[start] + interval * iIndex(),
          value[]
          /* add any dimension split (by:) field names here */
          )
| expand interval
| fieldsFlatten interval
| fieldsRemove interval
// *** timeseries interval splitter end ***&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query Output:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_irmer_1-1740177978262.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26592i98F4033B836EAF17/image-size/large?v=v2&amp;amp;px=999" role="button" title="marco_irmer_1-1740177978262.png" alt="marco_irmer_1-1740177978262.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 22:53:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/270741#M1679</guid>
      <dc:creator>marco_irmer</dc:creator>
      <dc:date>2025-02-21T22:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Pro-Tip: DQL Query Snippets Collection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/279788#M1687</link>
      <description>&lt;P&gt;&lt;SPAN&gt;DQL Builder &amp;amp; Validator dashboard&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-with-DQL-quot-DQL-Builder-amp-Validator-dashboard-quot/m-p/272983" target="_blank"&gt;https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-with-DQL-quot-DQL-Builder-amp-Validator-dashboard-quot/m-p/272983&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Team,&lt;/P&gt;&lt;P&gt;Please see this great DQL dashboard that was created by Dynatrace (everyone can download!).&amp;nbsp; Glad I checked Linkedin.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.linkedin.com/posts/imrankhan4z_dynatrace-grail-dql-activity-7298017012411232257-j2bH/?utm_source=share&amp;amp;utm_medium=member_desktop&amp;amp;rcm=ACoAABdKabkBrVmBXRygquWeCCKLYrWBiZXZddE" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.linkedin.com/posts/imrankhan4z_dynatrace-grail-dql-activity-7298017012411232257-j2bH/?ut...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hello&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://www.linkedin.com/company/dynatrace/" target="_self" rel="nofollow noopener noreferrer"&gt;&lt;SPAN&gt;Dynatrace&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;universe! Sharing another tool to help you get started with&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://www.linkedin.com/feed/hashtag/?keywords=dynatrace&amp;amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7298017012411232257" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;SPAN class=""&gt;hashtag&lt;/SPAN&gt;&lt;SPAN&gt;#Dynatrace&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://www.linkedin.com/feed/hashtag/?keywords=grail&amp;amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7298017012411232257" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;SPAN class=""&gt;hashtag&lt;/SPAN&gt;&lt;SPAN&gt;#GRAIL&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;. With this DQL Builder &amp;amp; Validator dashboard (&lt;/SPAN&gt;&lt;A class="" href="https://lnkd.in/eXNtxT4A" target="_self" rel="nofollow noopener noreferrer"&gt;https://lnkd.in/eXNtxT4A&lt;/A&gt;&lt;SPAN&gt;) you can easily search for any available data objects (entities, cloud, logs, spans, problems, etc.) and have a standard&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://www.linkedin.com/feed/hashtag/?keywords=dql&amp;amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7298017012411232257" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;SPAN class=""&gt;hashtag&lt;/SPAN&gt;&lt;SPAN&gt;#DQL&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ready with all available fields. If you would ask what fields are available for a data table in GRAIL, you can easily find that list or pick certain fields that you need. There's also a custom DQL validator to check if the query is correct. Thanks to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://www.linkedin.com/in/sowmiya1venkit79a45112/" target="_blank" rel="noopener nofollow noreferrer"&gt;Sowmiya Venkiteswaran&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://www.linkedin.com/in/bradley-danyo-25425111a/" target="_blank" rel="noopener nofollow noreferrer"&gt;Bradley Danyo&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;for assisting with this dashboard! Grab your copy from Dynatrace Playground here,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://lnkd.in/eXNtxT4A" target="_self" rel="nofollow noopener noreferrer"&gt;https://lnkd.in/eXNtxT4A&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2025 16:29:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/279788#M1687</guid>
      <dc:creator>Kenny_Gillette</dc:creator>
      <dc:date>2025-06-18T16:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Pro-Tip: DQL Query Snippets Collection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/279789#M1688</link>
      <description>&lt;P&gt;&lt;SPAN&gt;How to pull in Management Zones via DQL&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;dql&lt;/P&gt;&lt;P&gt;fetch dt.entity.service&lt;BR /&gt;| filter isNotNull(managementZones)&lt;BR /&gt;| fields managementZones&lt;BR /&gt;| dedup managementZones&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2025 16:44:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/279789#M1688</guid>
      <dc:creator>Kenny_Gillette</dc:creator>
      <dc:date>2025-06-18T16:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pro-Tip: DQL Query Snippets Collection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/290807#M1810</link>
      <description>&lt;P&gt;even simpler version:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {value = sum(dt.service.request.count), timeframe.start=start()}, interval: 1h

// *** timeseries interval splitter start ***
| fields  interval=record( timeframe.start[],value[]
          /* add any dimension split (by:) field names here */
          )
| expand interval
| fieldsFlatten interval
| fieldsRemove interval
// *** timeseries interval splitter end ***&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 03 Dec 2025 21:19:40 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-Tip-DQL-Query-Snippets-Collection/m-p/290807#M1810</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-12-03T21:19:40Z</dc:date>
    </item>
  </channel>
</rss>

