<?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 Add a variable to the “from:&amp;quot; and &amp;quot;to:” section of a DQL query in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Add-a-variable-to-the-from-quot-and-quot-to-section-of-a-DQL/m-p/273197#M1840</link>
    <description>&lt;P&gt;Is it possible to add a variable to the “from:" and&amp;nbsp; "to:” section of a DQL query that is fetching logs?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Background:&lt;/STRONG&gt; I have a dashboard that surfaces info from logs from a specific time of the day each morning. I want to be able to select a value in a dashboard variable that represents today, yesterday, 2 days ago, 3 days ago, etc. and have the dashboard show data for that specific time period of the chosen day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following DQL examples work correctly. I’d like to have a dashboard variable that changes the day being specified in the To and From sections.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Today:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;fetch logs, from: bin(now(), 1d)+ 5h + 50m, to: bin(now(), 1d) + 6h + 30m&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Yesterday&lt;/STRONG&gt;:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;fetch logs, from: bin(now()-1d, 1d)+ 5h + 50m, to: bin(now()-1d, 1d) + 6h + 30m&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Two Days Ago:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;fetch logs, from: bin(now()-2d, 1d)+ 5h + 50m, to: bin(now()-2d, 1d) + 6h + 30m&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is this possible? What would the DQL look like?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Mar 2025 14:10:03 GMT</pubDate>
    <dc:creator>cwinkler109</dc:creator>
    <dc:date>2025-03-21T14:10:03Z</dc:date>
    <item>
      <title>Add a variable to the “from:" and "to:” section of a DQL query</title>
      <link>https://community.dynatrace.com/t5/DQL/Add-a-variable-to-the-from-quot-and-quot-to-section-of-a-DQL/m-p/273197#M1840</link>
      <description>&lt;P&gt;Is it possible to add a variable to the “from:" and&amp;nbsp; "to:” section of a DQL query that is fetching logs?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Background:&lt;/STRONG&gt; I have a dashboard that surfaces info from logs from a specific time of the day each morning. I want to be able to select a value in a dashboard variable that represents today, yesterday, 2 days ago, 3 days ago, etc. and have the dashboard show data for that specific time period of the chosen day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following DQL examples work correctly. I’d like to have a dashboard variable that changes the day being specified in the To and From sections.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Today:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;fetch logs, from: bin(now(), 1d)+ 5h + 50m, to: bin(now(), 1d) + 6h + 30m&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Yesterday&lt;/STRONG&gt;:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;fetch logs, from: bin(now()-1d, 1d)+ 5h + 50m, to: bin(now()-1d, 1d) + 6h + 30m&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Two Days Ago:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;fetch logs, from: bin(now()-2d, 1d)+ 5h + 50m, to: bin(now()-2d, 1d) + 6h + 30m&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is this possible? What would the DQL look like?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 14:10:03 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Add-a-variable-to-the-from-quot-and-quot-to-section-of-a-DQL/m-p/273197#M1840</guid>
      <dc:creator>cwinkler109</dc:creator>
      <dc:date>2025-03-21T14:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Add a variable to the “from:" and "to:” section of a DQL query</title>
      <link>https://community.dynatrace.com/t5/DQL/Add-a-variable-to-the-from-quot-and-quot-to-section-of-a-DQL/m-p/274238#M1887</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/69707"&gt;@cwinkler109&lt;/a&gt;&amp;nbsp;you can accomplish this using a list variable, for example:&amp;nbsp;&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-left" image-alt="AustinSabel_2-1743605203094.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27361iC2E782CA16E5DA3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AustinSabel_2-1743605203094.png" alt="AustinSabel_2-1743605203094.png" /&gt;&lt;/span&gt;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&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;&lt;P&gt;Along with the following query:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;fetch logs, 
 from: duration(toLong(concat("-",$daysAgo)), unit:"d")@d+5h+50m, 
 to: duration(toLong(concat("-",$daysAgo)), unit:"d")@d+6h+30m
| summarize min(timestamp), max(timestamp)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a side note, just so I understand it, are you looking to create a dashboard that shows logs for a given day between 5:50am and 6:30am local time? If so, you may get some inconsistent responses using bin() format based on the timezone.&lt;/P&gt;&lt;P&gt;I've attached a copy of an example dashboard using this functionality and showing some differences between bin() and&amp;nbsp;@d.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 15:34:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Add-a-variable-to-the-from-quot-and-quot-to-section-of-a-DQL/m-p/274238#M1887</guid>
      <dc:creator>AustinSabel</dc:creator>
      <dc:date>2025-04-02T15:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add a variable to the “from:" and "to:” section of a DQL query</title>
      <link>https://community.dynatrace.com/t5/DQL/Add-a-variable-to-the-from-quot-and-quot-to-section-of-a-DQL/m-p/274385#M1894</link>
      <description>&lt;P&gt;Perfect. AustinSable, you are a DQL hero, and saved my dashboard. Thank you!!!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 20:58:48 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Add-a-variable-to-the-from-quot-and-quot-to-section-of-a-DQL/m-p/274385#M1894</guid>
      <dc:creator>cwinkler109</dc:creator>
      <dc:date>2025-04-03T20:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Add a variable to the “from:" and "to:” section of a DQL query</title>
      <link>https://community.dynatrace.com/t5/DQL/Add-a-variable-to-the-from-quot-and-quot-to-section-of-a-DQL/m-p/274784#M1923</link>
      <description>&lt;P&gt;Glad I could help!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2025 14:30:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Add-a-variable-to-the-from-quot-and-quot-to-section-of-a-DQL/m-p/274784#M1923</guid>
      <dc:creator>AustinSabel</dc:creator>
      <dc:date>2025-04-09T14:30:18Z</dc:date>
    </item>
  </channel>
</rss>

