<?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: TIPS - DQL Timeframe selection in Dynatrace tips</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/258997#M1463</link>
    <description>&lt;P&gt;Thanks for sharing useful tip.&lt;/P&gt;</description>
    <pubDate>Sat, 12 Oct 2024 13:23:11 GMT</pubDate>
    <dc:creator>Peter_Youssef</dc:creator>
    <dc:date>2024-10-12T13:23:11Z</dc:date>
    <item>
      <title>TIPS - DQL Timeframe selection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/228927#M1079</link>
      <description>&lt;P&gt;I'm taking the liberty of sharing this tip because I've seen several people share difficulties in selecting a specific timeframe with the DQL,&amp;nbsp;particularly when searching for information in the Logs.&lt;/P&gt;
&lt;P&gt;Here are some examples to get around current limitations :&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;For -1d/d :&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch logs,from:toTimestamp("T00:00:00")-1d&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;For -0d/d :&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch logs,from:toTimestamp("T00:00:00")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;For GMT+2 :&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch logs,from:toTimestamp("T00:00:00+2")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this TIP can be useful to as many people as possible &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Please let me know your comments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 11:03:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/228927#M1079</guid>
      <dc:creator>gbaudart</dc:creator>
      <dc:date>2023-11-21T11:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: TIPS - DQL Timeframe selection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/228931#M1080</link>
      <description>&lt;P&gt;Great&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt; Thank you it's a very useful&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 13:37:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/228931#M1080</guid>
      <dc:creator>radek_jasinski</dc:creator>
      <dc:date>2023-11-16T13:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: TIPS - DQL Timeframe selection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/229971#M1105</link>
      <description>&lt;P&gt;Great !&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 09:16:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/229971#M1105</guid>
      <dc:creator>g_pmu</dc:creator>
      <dc:date>2023-11-27T09:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: TIPS - DQL Timeframe selection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/231662#M1116</link>
      <description>&lt;P&gt;What is this "toTimestamp" function?&amp;nbsp; I tried searching for it and, while I see it used in examples in their documentation, I don't see any explanation of what the function actually is, and my Google searches aren't producing results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*&lt;STRONG&gt;EDIT&lt;/STRONG&gt;* Ahh, found it.&amp;nbsp; It's in their Conversion and Casting Functions section of their docs instead of in their Time functions section.&amp;nbsp; They should maybe cross-reference those though, just to make finding it easier.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 18:41:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/231662#M1116</guid>
      <dc:creator>36Krazyfists</dc:creator>
      <dc:date>2023-12-12T18:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: TIPS - DQL Timeframe selection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/238803#M1193</link>
      <description>&lt;P&gt;Hi all ,&lt;BR /&gt;&lt;BR /&gt;Thanks for the tip here&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;BR /&gt;Do you have any other tip if we want to go through relative timeframe?&lt;BR /&gt;&lt;BR /&gt;like if I want relative timings (like "&lt;SPAN&gt;now-1h/h to now-0h/h") or "from: now-1M/M to :now-0M/M" , I have the message "&lt;STRONG&gt;The parameter `from` has to be constant&lt;/STRONG&gt;"&lt;BR /&gt;I have not found any tips to do so.&lt;BR /&gt;&lt;BR /&gt;Temp solution I have found is to query larger data and then filter afterwards :&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|filter getHour(timestamp) &amp;gt;= (getHour(now())-1) and getHour(timestamp) &amp;lt; getHour(now())&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Is it possible to do it directly from timeframe filter ?&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Christophe&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 12:56:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/238803#M1193</guid>
      <dc:creator>Christophe_N</dc:creator>
      <dc:date>2024-03-04T12:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: TIPS - DQL Timeframe selection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/258997#M1463</link>
      <description>&lt;P&gt;Thanks for sharing useful tip.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 13:23:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/258997#M1463</guid>
      <dc:creator>Peter_Youssef</dc:creator>
      <dc:date>2024-10-12T13:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: TIPS - DQL Timeframe selection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/265049#M1522</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;additional tip , for those who wants to use dashboard timeframe in one calculation&lt;BR /&gt;&lt;BR /&gt;For example, if you want to use the timeframe of one&amp;nbsp;dashboard in one tile , here is a tip you can use :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| lookup [
data record(timestamp=now())
| makeTimeseries sum(1)
| fieldsAdd fk=1, timeframe=timeframe[end]-timeframe[start]-interval
], lookupField:fk, sourceField:fk, fields:{timeframe}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&amp;nbsp; you want to have Outage duration&amp;nbsp; calculation from Davis Events&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch events
| filter event.kind == "DAVIS_EVENT"

//you can add any filter here 
| fieldsAdd duration=event.end-event.start| filter isNotNull(duration)
| fields event.start,event.end,duration,arrayLast(entity_tags),Tags=arrayFlatten(entity_tags) 
| summarize `Outage Duration`= sum(duration), by:{ Tags}
| fieldsAdd fk=1
| lookup [
data record(timestamp=now())
| makeTimeseries sum(1)
| fieldsAdd fk=1, timeframe=timeframe[end]-timeframe[start]-interval
], lookupField:fk, sourceField:fk, fields:{timeframe}
| fieldsadd `Availability : 100%-duration outage`= if(100*(1-(`Outage Duration`/timeframe))&amp;gt;0,(100*(1-(`Outage Duration`/timeframe))),else:100) , `Outage Duration`=if(isNull(`Outage Duration`),0,else:`Outage Duration`)
| fields Tags,`Availability : 100%-duration outage`,`Outage Duration`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kudo to the support team to have found this while I got exotic request &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Christophe&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:46:23 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/265049#M1522</guid>
      <dc:creator>Christophe_N</dc:creator>
      <dc:date>2024-12-11T17:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: TIPS - DQL Timeframe selection</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/275289#M1613</link>
      <description>&lt;P&gt;Thanks, very helpful! A small &lt;STRONG&gt;additional&lt;/STRONG&gt; hint when interested in&lt;STRONG&gt; UTC&lt;/STRONG&gt;. Add the &lt;STRONG&gt;"Z"&lt;/STRONG&gt; to your timestamp format. Example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch events, from:toTimestamp("T00:00:00Z")-1d, to: toTimestamp("T00:00:00Z")
| summarize by: {}, sum=count()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;gives use the count of events for yesterday, measured in UTC.&lt;/P&gt;&lt;P&gt;Edit: "T00:00:00Z" appears to be just a shortcut for "T00:00:00+0"&lt;/P&gt;&lt;P&gt;Cheers, PJ.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Apr 2025 10:15:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/TIPS-DQL-Timeframe-selection/m-p/275289#M1613</guid>
      <dc:creator>Peter_Jelitsch1</dc:creator>
      <dc:date>2025-04-16T10:15:25Z</dc:date>
    </item>
  </channel>
</rss>

