<?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: How do I set search start time and end time on dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306266#M19500</link>
    <description>&lt;P&gt;Hello ssievert, &lt;BR /&gt;
Thank you for your response,&lt;BR /&gt;
The above is working fine when we are running on the same day. But throwing error if run on next day, I need to set like as below,&lt;/P&gt;

&lt;P&gt;11/01/2017 - 07 AM to 11/02/2017 5 PM - whenever I am running my dashboard between the mentioned time frame, I need it should take start time time as 11/01/2017 - 07 AM.&lt;/P&gt;

&lt;P&gt;Your query is taking 11/01/2017 - 07 AM, when we run on the day 11/01/2017, Throwing error while running on 11/02/2017.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Nov 2017 06:00:06 GMT</pubDate>
    <dc:creator>Kwip</dc:creator>
    <dc:date>2017-11-02T06:00:06Z</dc:date>
    <item>
      <title>How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306261#M19495</link>
      <description>&lt;P&gt;I want to monitor my dashboard from today 7 Am to tomorrow 5 AM.  I don't want to set the time manually. &lt;/P&gt;

&lt;P&gt;FYI, My dashboard contains list of jobs running from 7AM to next day 5AM. &lt;/P&gt;

&lt;P&gt;I need to monitor the progress continuously, so set up the auto refresh on every 5 minutes. Now I want to set the time  in such a way that  it will take the start time as 7AM today and end time is now or next day 5AM during every refresh.&lt;/P&gt;

&lt;P&gt;Please take a look and let me know the possibilities. Thanks in advance!!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 05:50:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306261#M19495</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2017-10-13T05:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306262#M19496</link>
      <description>&lt;P&gt;If I understand it right, your dashboard has an inline search and you want to know how to set &lt;STRONG&gt;earliest&lt;/STRONG&gt; and &lt;STRONG&gt;latest&lt;/STRONG&gt; such that it always searches from 7am of the current day to whenever your dashboard refreshes. If that's not what you are asking, please clarify.&lt;/P&gt;

&lt;P&gt;Current day at 7am would be &lt;CODE&gt;earliest=@d+7h&lt;/CODE&gt; (@d = beginning of current day).&lt;BR /&gt;
Setting latest to a time in the future doesn't really make sense, unless what you are searching for can come in with timestamps in the future. You are probably okay setting &lt;CODE&gt;latest=now&lt;/CODE&gt;, but you could also set &lt;CODE&gt;latest=+d@d+5h&lt;/CODE&gt;, which would be next day at 5am.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 06:20:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306262#M19496</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-10-13T06:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306263#M19497</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;.....&amp;lt;/query&amp;gt;
            &amp;lt;earliest&amp;gt;@d+7h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
 &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Oct 2017 09:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306263#M19497</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2017-10-14T09:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306264#M19498</link>
      <description>&lt;P&gt;Hi  Kwip,&lt;/P&gt;

&lt;P&gt;Can you please do implement below 2 points.&lt;/P&gt;

&lt;P&gt;1)  Add a search that will calculate earliest and latest. And use It in searches of all panels of your dashboard. You can directly use below code in your dashboard.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| makeresults | eval starttime=strptime(strftime(now(),"%d/%m/%Y 07:00:00 AM"),"%d/%m/%Y %I:%M:%S %p") , endtime=starttime+79200 &amp;lt;/query&amp;gt;
    &amp;lt;preview&amp;gt;
      &amp;lt;set token="myEarliest"&amp;gt;$result.starttime$&amp;lt;/set&amp;gt;
      &amp;lt;set token="myLatest"&amp;gt;$result.endtime$&amp;lt;/set&amp;gt;
    &amp;lt;/preview&amp;gt;
  &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2)  For auto-refreshing dashboard, I'm suggesting you refresh panels in every 5 minutes.  Please add refresh tags into search manager of all panels.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;refresh&amp;gt;5m&amp;lt;/refresh&amp;gt;
  &amp;lt;refreshType&amp;gt;delay&amp;lt;/refreshType&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Below is sample dashboard code for reference.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Sample Dashboard&amp;lt;/label&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| makeresults | eval starttime=strptime(strftime(now(),"%d/%m/%Y 07:00:00 AM"),"%d/%m/%Y %I:%M:%S %p") , endtime=starttime+79200 &amp;lt;/query&amp;gt;
    &amp;lt;preview&amp;gt;
      &amp;lt;set token="myEarliest"&amp;gt;$result.starttime$&amp;lt;/set&amp;gt;
      &amp;lt;set token="myLatest"&amp;gt;$result.endtime$&amp;lt;/set&amp;gt;
    &amp;lt;/preview&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;$myEarliest$-$myLatest$&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|stats count | addinfo&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$myEarliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$myLatest$&amp;lt;/latest&amp;gt;
          &amp;lt;refresh&amp;gt;5m&amp;lt;/refresh&amp;gt;
          &amp;lt;refreshType&amp;gt;delay&amp;lt;/refreshType&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope this will help you.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2017 14:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306264#M19498</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-10-15T14:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306265#M19499</link>
      <description>&lt;P&gt;Hello 493669,&lt;BR /&gt;
Thank you for your response,&lt;BR /&gt;
The above is working fine when we are running on the same day. But throwing error if run on next day, I need to set like as below,&lt;/P&gt;

&lt;P&gt;11/01/2017 - 07 AM to 11/02/2017 5 PM - whenever I am running my dashboard between the mentioned time frame, I need it should take start time time as 11/01/2017 - 07 AM.&lt;/P&gt;

&lt;P&gt;Your query is taking 11/01/2017 - 07 AM, when we run on the day 11/01/2017, Throwing error while running on 11/02/2017.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 05:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306265#M19499</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2017-11-02T05:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306266#M19500</link>
      <description>&lt;P&gt;Hello ssievert, &lt;BR /&gt;
Thank you for your response,&lt;BR /&gt;
The above is working fine when we are running on the same day. But throwing error if run on next day, I need to set like as below,&lt;/P&gt;

&lt;P&gt;11/01/2017 - 07 AM to 11/02/2017 5 PM - whenever I am running my dashboard between the mentioned time frame, I need it should take start time time as 11/01/2017 - 07 AM.&lt;/P&gt;

&lt;P&gt;Your query is taking 11/01/2017 - 07 AM, when we run on the day 11/01/2017, Throwing error while running on 11/02/2017.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 06:00:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306266#M19500</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2017-11-02T06:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306267#M19501</link>
      <description>&lt;P&gt;@kamlesh_vaghela, Sorry for the delayed response&lt;BR /&gt;
I tried the above one, But once midnoght crossed it is taking that day 7 AM to next next day 5 AM.&lt;/P&gt;

&lt;P&gt;Say Example, I had tried it out at 1 AM 27/12/2017&lt;/P&gt;

&lt;P&gt;It is taking start time at 27/12/2017 7AM and end time as 28/12/2017&lt;/P&gt;

&lt;P&gt;But the expectation is till 27/12/2017 5 AM, the start and end time should be as below,&lt;/P&gt;

&lt;P&gt;26/12/2017 7 AM to 27/12/2017 5AM&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 07:18:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306267#M19501</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2017-12-27T07:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306268#M19502</link>
      <description>&lt;P&gt;HI @,&lt;/P&gt;

&lt;P&gt;Can you please try this XML?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
   &amp;lt;label&amp;gt;Sample Dashboard&amp;lt;/label&amp;gt;
   &amp;lt;search&amp;gt;
     &amp;lt;query&amp;gt;| makeresults | eval H=tonumber(strftime(now(),"%H")), NOW = if(H&amp;amp;lt;5,now()-20000,now()) | eval starttime=strptime(strftime(NOW,"%d/%m/%Y 07:00:00 AM"),"%d/%m/%Y %I:%M:%S %p") , endtime=starttime+79200 &amp;lt;/query&amp;gt;
     &amp;lt;preview&amp;gt;
       &amp;lt;set token="myEarliest"&amp;gt;$result.starttime$&amp;lt;/set&amp;gt;
       &amp;lt;set token="myLatest"&amp;gt;$result.endtime$&amp;lt;/set&amp;gt;
     &amp;lt;/preview&amp;gt;
   &amp;lt;/search&amp;gt;
   &amp;lt;row&amp;gt;
     &amp;lt;panel&amp;gt;
       &amp;lt;table&amp;gt;
         &amp;lt;title&amp;gt;$myEarliest$-$myLatest$&amp;lt;/title&amp;gt;
         &amp;lt;search&amp;gt;
           &amp;lt;query&amp;gt;|stats count | addinfo&amp;lt;/query&amp;gt;
           &amp;lt;earliest&amp;gt;$myEarliest$&amp;lt;/earliest&amp;gt;
           &amp;lt;latest&amp;gt;$myLatest$&amp;lt;/latest&amp;gt;
           &amp;lt;refresh&amp;gt;5m&amp;lt;/refresh&amp;gt;
           &amp;lt;refreshType&amp;gt;delay&amp;lt;/refreshType&amp;gt;
         &amp;lt;/search&amp;gt;
         &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
       &amp;lt;/table&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
 &amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have made the change in the search query.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Kamlesh&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 18:27:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306268#M19502</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-12-27T18:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306269#M19503</link>
      <description>&lt;P&gt;It is working fine.. Thank you very Much..&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 07:29:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306269#M19503</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2017-12-28T07:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306270#M19504</link>
      <description>&lt;P&gt;Glad to help you. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 07:33:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306270#M19504</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-12-28T07:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306271#M19505</link>
      <description>&lt;P&gt;@kamlesh_vaghela,&lt;BR /&gt;
Could you please tell me how to calculate this value 79200?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 08:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306271#M19505</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2017-12-28T08:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306272#M19506</link>
      <description>&lt;P&gt;Hi @Kwip,&lt;/P&gt;

&lt;P&gt;It is total seconds of 22 hrs. &lt;BR /&gt;
1hr = 3600 sec&lt;BR /&gt;
22 hrs = 79200 sec&lt;/P&gt;

&lt;P&gt;7 AM + 22 hrs = Next Day 5 AM.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 09:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306272#M19506</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-12-28T09:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306273#M19507</link>
      <description>&lt;P&gt;Hi @kwip,&lt;BR /&gt;
Can you try below eval in your xml for start and end time?&lt;BR /&gt;
strptime(strftime(relative_time(time(), "-1d@d"),"%d/%m/%Y 07:00:00 AM"),"%d/%m/%Y %I:%M:%S %p")&lt;BR /&gt;&lt;BR /&gt;
starttime+79200&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 11:37:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306273#M19507</guid>
      <dc:creator>nikita_p</dc:creator>
      <dc:date>2017-12-28T11:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306274#M19508</link>
      <description>&lt;P&gt;Hi @kamlesh_vaghela&lt;/P&gt;

&lt;P&gt;Just wondering what this portion is performing &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eval H=tonumber(strftime(now(),"%H")), NOW = if(H&amp;amp;lt;5,now()-20000,now())&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Could you please explain it. &lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 03:45:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306274#M19508</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2018-04-06T03:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set search start time and end time on dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306275#M19509</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;,&lt;BR /&gt;
I am using this in my dashboard, for earliest and latest time. It is working fine but there is small issue. Whenever I am launching the dashboard, getting invalid earliest time message first and then the data getting loaded. So when I am trying to schedule the dashboard pdf delivery. getting invalid_earliest time message in all the panels.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| makeresults | eval&lt;BR /&gt;
H=tonumber(strftime(now(),"%H")), NOW&lt;BR /&gt;
= if(H&amp;lt;5,now()-20000,now()) | eval starttime=strptime(strftime(NOW,"%d/%m/%Y&lt;BR /&gt;
07:00:00 AM"),"%d/%m/%Y %I:%M:%S %p")&lt;BR /&gt;
, endtime=starttime+79200 &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:42:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-set-search-start-time-and-end-time-on-dashboard/m-p/306275#M19509</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2020-09-29T20:42:30Z</dc:date>
    </item>
  </channel>
</rss>

