<?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 Default Start Timerange from 10am in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390493#M69860</link>
    <description>&lt;P&gt;I am working on a wall board dashboard regarding incidents created from 10am till now. So if it is before 10am I want to return results from 10am yesterday. If it is after 10am today then I want results from 10am today.&lt;/P&gt;

&lt;P&gt;I found the syntax for for getting all the results for the beginning of the current week &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=@w0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I was hoping there might be something similar like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=@h10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
    <pubDate>Fri, 24 May 2019 04:02:13 GMT</pubDate>
    <dc:creator>Melstrathdee</dc:creator>
    <dc:date>2019-05-24T04:02:13Z</dc:date>
    <item>
      <title>Default Start Timerange from 10am</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390493#M69860</link>
      <description>&lt;P&gt;I am working on a wall board dashboard regarding incidents created from 10am till now. So if it is before 10am I want to return results from 10am yesterday. If it is after 10am today then I want results from 10am today.&lt;/P&gt;

&lt;P&gt;I found the syntax for for getting all the results for the beginning of the current week &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=@w0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I was hoping there might be something similar like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=@h10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 04:02:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390493#M69860</guid>
      <dc:creator>Melstrathdee</dc:creator>
      <dc:date>2019-05-24T04:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Default Start Timerange from 10am</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390494#M69861</link>
      <description>&lt;P&gt;use &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest = @d+10h
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For events after 10am today&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 04:10:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390494#M69861</guid>
      <dc:creator>nabeel652</dc:creator>
      <dc:date>2019-05-24T04:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Default Start Timerange from 10am</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390495#M69862</link>
      <description>&lt;P&gt;Thanks nabell652  we are on the same page  I'm currently using but it only works for events when I'm looking at the dashboard between 10am and midnight.&lt;/P&gt;

&lt;P&gt;I also need to cover midnight to 9:59.&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 04:21:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390495#M69862</guid>
      <dc:creator>Melstrathdee</dc:creator>
      <dc:date>2019-05-24T04:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Default Start Timerange from 10am</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390496#M69863</link>
      <description>&lt;P&gt;if it is in a different search you can use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=@d latest=@d+10h
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And for 10am till now&lt;/P&gt;

&lt;P&gt;earliest=@d+10h latest=now&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 04:30:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390496#M69863</guid>
      <dc:creator>nabeel652</dc:creator>
      <dc:date>2019-05-24T04:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Default Start Timerange from 10am</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390497#M69864</link>
      <description>&lt;P&gt;I found the solution:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Logic:&lt;/STRONG&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;a "normal day" is 10am till 10am each day. &lt;/LI&gt;
&lt;LI&gt;So if it is before 10am - the time range will be 10am the previous day till the current time. &lt;/LI&gt;
&lt;LI&gt;If it is after 10am then the time will from 10am today till now.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;STRONG&gt;Date Time Calculation:&lt;/STRONG&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;we run a base search with the id of DatePicker&lt;/LI&gt;
&lt;LI&gt;To do this we calculate the current time and set the hnow to be the current hour.&lt;/LI&gt;
&lt;LI&gt;Then we run an if statement to set the earliest time variable based on if it is before 10am&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;when the search is done we set the earliest time range token.&lt;/P&gt;

&lt;P&gt;&lt;SEARCH id="DatePicker"&gt;&lt;BR /&gt;
    &lt;QUERY&gt;&lt;BR /&gt;
    | makeresults | head 1 | eval hnow = strftime(now(), "%H")&lt;BR /&gt;
| fields hnow&lt;BR /&gt;
| eval x=if(hnow &amp;gt; 9,"@d+10h","-1d@d+10h")&lt;BR /&gt;
&lt;/QUERY&gt;&lt;BR /&gt;
    &lt;EARLIEST&gt;-1m&lt;/EARLIEST&gt;&lt;BR /&gt;
    &lt;LATEST&gt;now&lt;/LATEST&gt;&lt;BR /&gt;
    &lt;REFRESH&gt;1m&lt;/REFRESH&gt;&lt;BR /&gt;
    &lt;DONE&gt;&lt;BR /&gt;
              &lt;SET token="timerange.earliest"&gt;$result.x$&lt;/SET&gt;&lt;BR /&gt;
    &lt;/DONE&gt;&lt;BR /&gt;
  &lt;/SEARCH&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Hope this helps someone else.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 00:53:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Default-Start-Timerange-from-10am/m-p/390497#M69864</guid>
      <dc:creator>Melstrathdee</dc:creator>
      <dc:date>2019-05-31T00:53:42Z</dc:date>
    </item>
  </channel>
</rss>

