<?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: Time Picker in the Dashboard not working as expected. in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Time-Picker-in-the-Dashboard-not-working-as-expected/m-p/483112#M31670</link>
    <description>&lt;P&gt;Your approach seems very strange to me but in any case, you are missing dollar-signs, so like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;eval token="earliestTime"&amp;gt;if(isstr(earliest), relative_time(now(),earliest), earliest)&amp;lt;/eval&amp;gt;
&amp;lt;eval token="latestTime"&amp;gt;if(isstr(latest), relative_time(now(),latest), latest)&amp;lt;/eval&amp;gt;
&amp;lt;eval token="earliestTime1"&amp;gt;relative_time($earliestTime$,"-7d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="latestTime1"&amp;gt;relative_time($latestTime$,"-7d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="earliestTime2"&amp;gt;relative_time($earliestTime$,"-14d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="latestTime2"&amp;gt;relative_time($latestTime$,"-14d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="earliestTime3"&amp;gt;relative_time($earliestTime$,"-21d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="latestTime3"&amp;gt;relative_time($latestTime$,"-21d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="earliestTime4"&amp;gt;relative_time($earliestTime$,"-28d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="latestTime4"&amp;gt;relative_time($latestTime$,"-28d")&amp;lt;/eval&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 03 Dec 2019 04:34:20 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-12-03T04:34:20Z</dc:date>
    <item>
      <title>Time Picker in the Dashboard not working as expected.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Time-Picker-in-the-Dashboard-not-working-as-expected/m-p/483109#M31667</link>
      <description>&lt;P&gt;We have a dashboard . When we select time period say 11/13/19 (9 am to 11 am ). The results are displying from 11/13/19 (8 am to 10 am) and the results consist of all zeros in between 8 to 9 am where there are values from 9 to 10 am . I think the zeros are diplaying because it's not the correct time. I don't think it's a timezone issue. How can we fix time picker for the dashboard so that it will only displays the results for selected time period(8 am 10 am) with no zeros? &lt;BR /&gt;
Here are the tokens used for the source code&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;eval token="earliestTime"&amp;gt;if(isstr(earliest), relative_time(now(),earliest), earliest)&amp;lt;/eval&amp;gt;
 &amp;lt;eval token="latestTime"&amp;gt;if(isstr(latest), relative_time(now(),latest), latest)&amp;lt;/eval&amp;gt;
 &amp;lt;eval token="earliestTime1"&amp;gt;relative_time(earliestTime,"-7d")&amp;lt;/eval&amp;gt;
 &amp;lt;eval token="latestTime1"&amp;gt;relative_time(latestTime,"-7d")&amp;lt;/eval&amp;gt;
 &amp;lt;eval token="earliestTime2"&amp;gt;relative_time(earliestTime,"-14d")&amp;lt;/eval&amp;gt;
 &amp;lt;eval token="latestTime2"&amp;gt;relative_time(latestTime,"-14d")&amp;lt;/eval&amp;gt;
 &amp;lt;eval token="earliestTime3"&amp;gt;relative_time(earliestTime,"-21d")&amp;lt;/eval&amp;gt;
 &amp;lt;eval token="latestTime3"&amp;gt;relative_time(latestTime,"-21d")&amp;lt;/eval&amp;gt;
 &amp;lt;eval token="earliestTime4"&amp;gt;relative_time(earliestTime,"-28d")&amp;lt;/eval&amp;gt;
 &amp;lt;eval token="latestTime4"&amp;gt;relative_time(latestTime,"-28d")&amp;lt;/eval&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2019 22:22:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Time-Picker-in-the-Dashboard-not-working-as-expected/m-p/483109#M31667</guid>
      <dc:creator>iamsplunker31</dc:creator>
      <dc:date>2019-11-13T22:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Time Picker in the Dashboard not working as expected.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Time-Picker-in-the-Dashboard-not-working-as-expected/m-p/483110#M31668</link>
      <description>&lt;P&gt;Have you played around with relative time modifiers such as @h? &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/SearchTimeModifiers#Searching_the_time_and_fields"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/SearchTimeModifiers#Searching_the_time_and_fields&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In this sense, you can have everything snap to the nearest hour, for example:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;relative_time(now(),"-h@h"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;will snap to 7 PM whether you run this at 8:02 PM or 8:47 PM.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 22:50:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Time-Picker-in-the-Dashboard-not-working-as-expected/m-p/483110#M31668</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-11-13T22:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Time Picker in the Dashboard not working as expected.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Time-Picker-in-the-Dashboard-not-working-as-expected/m-p/483111#M31669</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/208970"&gt;@aberkow&lt;/a&gt;, Thank you for your response. &lt;BR /&gt;
1)Do you mean I need to update the tokens as below?&lt;BR /&gt;
if(isstr(earliest), relative_time(now(),"-h@h"earliest), earliest)&lt;BR /&gt;
if(isstr(latest), relative_time(now(),"-h@h"latest), latest)&lt;BR /&gt;
2) When you say if we run the search 8:02 PM or 8:47 PM will snap it to 7 PM. Can't we fix the dashboard/time picker to take specific time. In our case 9am to 11 am&lt;BR /&gt;
Please Advise&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:57:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Time-Picker-in-the-Dashboard-not-working-as-expected/m-p/483111#M31669</guid>
      <dc:creator>iamsplunker31</dc:creator>
      <dc:date>2020-09-30T02:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Time Picker in the Dashboard not working as expected.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Time-Picker-in-the-Dashboard-not-working-as-expected/m-p/483112#M31670</link>
      <description>&lt;P&gt;Your approach seems very strange to me but in any case, you are missing dollar-signs, so like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;eval token="earliestTime"&amp;gt;if(isstr(earliest), relative_time(now(),earliest), earliest)&amp;lt;/eval&amp;gt;
&amp;lt;eval token="latestTime"&amp;gt;if(isstr(latest), relative_time(now(),latest), latest)&amp;lt;/eval&amp;gt;
&amp;lt;eval token="earliestTime1"&amp;gt;relative_time($earliestTime$,"-7d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="latestTime1"&amp;gt;relative_time($latestTime$,"-7d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="earliestTime2"&amp;gt;relative_time($earliestTime$,"-14d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="latestTime2"&amp;gt;relative_time($latestTime$,"-14d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="earliestTime3"&amp;gt;relative_time($earliestTime$,"-21d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="latestTime3"&amp;gt;relative_time($latestTime$,"-21d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="earliestTime4"&amp;gt;relative_time($earliestTime$,"-28d")&amp;lt;/eval&amp;gt;
&amp;lt;eval token="latestTime4"&amp;gt;relative_time($latestTime$,"-28d")&amp;lt;/eval&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Dec 2019 04:34:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Time-Picker-in-the-Dashboard-not-working-as-expected/m-p/483112#M31670</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-03T04:34:20Z</dc:date>
    </item>
  </channel>
</rss>

