<?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 snap to 5 minute increments in timerange in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/snap-to-5-minute-increments-in-timerange/m-p/35419#M1556</link>
    <description>&lt;P&gt;I have data that needs to evaluated over periods that end on 5 minute boundaries&lt;/P&gt;

&lt;P&gt;I would like to be able to snap to a search end time that ends on an even 5 minute increment like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search ABC earliest=-2h@h latest=[most recent 5 minute increment] | ..... 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So if this search were run at 13:57:33 the actual time range would be from 11:00:00 to 13:55:00&lt;/P&gt;

&lt;P&gt;I have tried all sorts of permutations like &lt;STRONG&gt;latest=h@5m&lt;/STRONG&gt; (not valid syntax) but they are not producing the desired results of ending on an even (12:55:00) time boundary.&lt;/P&gt;

&lt;P&gt;I would appreciate thoughts on how best to accomplish this.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2013 23:28:54 GMT</pubDate>
    <dc:creator>charleswheelus</dc:creator>
    <dc:date>2013-08-14T23:28:54Z</dc:date>
    <item>
      <title>snap to 5 minute increments in timerange</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/snap-to-5-minute-increments-in-timerange/m-p/35419#M1556</link>
      <description>&lt;P&gt;I have data that needs to evaluated over periods that end on 5 minute boundaries&lt;/P&gt;

&lt;P&gt;I would like to be able to snap to a search end time that ends on an even 5 minute increment like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search ABC earliest=-2h@h latest=[most recent 5 minute increment] | ..... 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So if this search were run at 13:57:33 the actual time range would be from 11:00:00 to 13:55:00&lt;/P&gt;

&lt;P&gt;I have tried all sorts of permutations like &lt;STRONG&gt;latest=h@5m&lt;/STRONG&gt; (not valid syntax) but they are not producing the desired results of ending on an even (12:55:00) time boundary.&lt;/P&gt;

&lt;P&gt;I would appreciate thoughts on how best to accomplish this.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2013 23:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/snap-to-5-minute-increments-in-timerange/m-p/35419#M1556</guid>
      <dc:creator>charleswheelus</dc:creator>
      <dc:date>2013-08-14T23:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: snap to 5 minute increments in timerange</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/snap-to-5-minute-increments-in-timerange/m-p/35420#M1557</link>
      <description>&lt;P&gt;After a bit of poking around, This syntax works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search ABC earliest=-2h@h [ stats count | eval latest=(floor(now()/300))*300 | fields latest ]  | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Aug 2013 23:33:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/snap-to-5-minute-increments-in-timerange/m-p/35420#M1557</guid>
      <dc:creator>charleswheelus</dc:creator>
      <dc:date>2013-08-14T23:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: snap to 5 minute increments in timerange</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/snap-to-5-minute-increments-in-timerange/m-p/35421#M1558</link>
      <description>&lt;P&gt;Is there any other way to achieve this in the latest versions of splunk ?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 12:50:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/snap-to-5-minute-increments-in-timerange/m-p/35421#M1558</guid>
      <dc:creator>immortalraghava</dc:creator>
      <dc:date>2018-02-22T12:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: snap to 5 minute increments in timerange</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/snap-to-5-minute-increments-in-timerange/m-p/579058#M47418</link>
      <description>&lt;P&gt;The extra parenthesis around the floor function causes it to no longer work. So it should now be ...&lt;/P&gt;&lt;PRE&gt;search ABC earliest=-2h@h [ stats count | eval latest=floor(now()/300)*300 | fields latest ] | ...&lt;/PRE&gt;&lt;P&gt;However, I think for newer Splunk this is better and looks easier to read ...&lt;/P&gt;&lt;PRE&gt;search ABC earliest=-2h@h latest=[makeresults | eval snap=floor(now()/300)*300 | return $snap]&amp;nbsp;| ...&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Dec 2021 19:46:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/snap-to-5-minute-increments-in-timerange/m-p/579058#M47418</guid>
      <dc:creator>dstuder</dc:creator>
      <dc:date>2021-12-21T19:46:23Z</dc:date>
    </item>
  </channel>
</rss>

