<?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: Timeinput and token in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468626#M30744</link>
    <description>&lt;P&gt;If I use earliest=$time_finder.earliest$ latest=$time_finder.latest$ , would I need 4 sets or earliest and latest?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 02:44:26 GMT</pubDate>
    <dc:creator>kishan2356</dc:creator>
    <dc:date>2020-09-30T02:44:26Z</dc:date>
    <item>
      <title>Timeinput and token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468621#M30739</link>
      <description>&lt;P&gt;I have a dashboard where I need to users to be able to select from the time input . When a time is selected from the input I need it to stored into the time_finder token so it can be used to find data for current(the time selected from picker) , time_finder-1week ago, time_finder-2 weeks ago, time_finder-3 weeks ago and time_finder-4 weeks ago.  &lt;/P&gt;

&lt;P&gt;This is how I have the tokens set now.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;eval token="earliestTime"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-0d")&amp;lt;/eval&amp;gt;    
    &amp;lt;eval token="latestTime"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-0d")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="earliestTime1"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-7d")&amp;lt;/eval&amp;gt;        
    &amp;lt;eval token="latestTime1"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-6d")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="earliestTime2"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-14d")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="latestTime2"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-13d")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="earliestTime3"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-21d")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="latestTime3"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-20")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="earliestTime4"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-28")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="latestTime4"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-27d")&amp;lt;/eval&amp;gt;  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I use in my query to reference the tokens is this : earliest=$time_finder$ latest=$time_finder$&lt;/P&gt;

&lt;P&gt;The error I am getting is "Search is waiting for input". How can I fix this? If my question does not make sense please let me know and I will clarify/provide more info. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:44:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468621#M30739</guid>
      <dc:creator>kishan2356</dc:creator>
      <dc:date>2020-09-30T02:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Timeinput and token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468622#M30740</link>
      <description>&lt;P&gt;I'm guessing $time_finder$ is the name of the variable storing the time input. If yes, you need to do the following&lt;/P&gt;

&lt;P&gt;earliest=$time_finder.earliest$ latest=$time_finder.latest$&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:44:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468622#M30740</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2020-09-30T02:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Timeinput and token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468623#M30741</link>
      <description>&lt;P&gt;I made the change but it does not work.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 18:05:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468623#M30741</guid>
      <dc:creator>kishan2356</dc:creator>
      <dc:date>2019-10-23T18:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Timeinput and token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468624#M30742</link>
      <description>&lt;P&gt;Can you post the complete XML for the time input&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 18:07:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468624#M30742</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-10-23T18:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Timeinput and token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468625#M30743</link>
      <description>&lt;P&gt;XXXXXX&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="time" token="time_finder" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Time Picker&amp;lt;/label&amp;gt;
  &amp;lt;default&amp;gt;
    &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
  &amp;lt;/default&amp;gt;
  &amp;lt;change&amp;gt;
    &amp;lt;eval token="earliestTime"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-0d")&amp;lt;/eval&amp;gt;    
    &amp;lt;eval token="latestTime"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-0d")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="earliestTime1"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-7d")&amp;lt;/eval&amp;gt;        
    &amp;lt;eval token="latestTime1"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-6d")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="earliestTime2"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-14d")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="latestTime2"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-13d")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="earliestTime3"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-21d")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="latestTime3"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-20")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="earliestTime4"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-28")&amp;lt;/eval&amp;gt;  
    &amp;lt;eval token="latestTime4"&amp;gt;relative_time(strptime($time_finder$,"%Y/%m/%d %H:%M:%S"),"-27d")&amp;lt;/eval&amp;gt;  
  &amp;lt;/change&amp;gt;
&amp;lt;/input&amp;gt;


&amp;lt;panel&amp;gt;
  &amp;lt;title&amp;gt;XXXXXXXX&amp;lt;/title&amp;gt;
  &amp;lt;table&amp;gt;

    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=XX sourcetype=XX | bin _time span=5m | stats dc(ecn) as Now  by _time | appendcols [ search index=XX sourcetype=XX earliest=$earliestTime1.earliest$ latest=$latestTime1.latest$ | bin _time span=5m  |stats dc(ecn) as Count_SameDay_LastWeek by _time ] | appendcols [search index=XX sourcetype=XX  earliest=$earliestTime2.earliest$ latest=$latestTime2.latest$  | bin _time span=5m  |stats dc(ecn) as TwoWeeksAgo by _time] | appendcols [search index=XX sourcetype=XX  | bin _time span=5m  |stats dc(ecn) as ThreeWeeksAgo by _time] | appendcols [search index=XX sourcetype=XX  earliest=$earliestTime4$ latest=$latestTime4.latest$  | bin _time span=5m  |stats dc(ecn) as FourWeeksAgo by _time] | eval ...... | fields .........&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;$earliest.earliest$&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;$latest.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
    &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
    &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;format type="number" field="Diff2"&amp;gt;
      &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
    &amp;lt;/format&amp;gt;
    &amp;lt;format type="number" field="Estimated_Impact"&amp;gt;
      &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
    &amp;lt;/format&amp;gt;
    &amp;lt;format type="number" field="Avg_of_Diff1&amp;amp;amp;2"&amp;gt;
      &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
    &amp;lt;/format&amp;gt;
    &amp;lt;format type="number" field="AvgOfFourWeeks_SameDay"&amp;gt;
      &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
      &amp;lt;option name="useThousandSeparators"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;/format&amp;gt;
    &amp;lt;format type="number" field="Avg_of_Diff_of_today_to_lastweek&amp;amp;amp;Diff_of_today_to_avgOfPrior4weeks"&amp;gt;
      &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
    &amp;lt;/format&amp;gt;
    &amp;lt;format type="number" field="Diff_of_today_to_avgOfPrior4weeks"&amp;gt;
      &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
    &amp;lt;/format&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Oct 2019 18:39:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468625#M30743</guid>
      <dc:creator>kishan2356</dc:creator>
      <dc:date>2019-10-23T18:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Timeinput and token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468626#M30744</link>
      <description>&lt;P&gt;If I use earliest=$time_finder.earliest$ latest=$time_finder.latest$ , would I need 4 sets or earliest and latest?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:44:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468626#M30744</guid>
      <dc:creator>kishan2356</dc:creator>
      <dc:date>2020-09-30T02:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Timeinput and token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468627#M30745</link>
      <description>&lt;P&gt;In response to the sample example you posted, Try this. Please mark as answer if this is what you were looking for&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;test_dash&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="time_finder" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Time Picker&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
      &amp;lt;change&amp;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;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;XXXXXXXXX&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=XX sourcetype=XX 
| bin _time span=5m 
| stats dc(ecn) as Now by _time 
| appendcols 
    [ search index=XX sourcetype=XX earliest=$earliestTime1$ latest=$latestTime1$ 
    | bin _time span=5m 
    | stats dc(ecn) as Count_SameDay_LastWeek by _time ] 
| appendcols 
    [ search index=XX sourcetype=XX earliest=$earliestTime2$ latest=$latestTime2$ 
    | bin _time span=5m 
    | stats dc(ecn) as TwoWeeksAgo by _time] 
| appendcols 
    [ search index=XX sourcetype=XX  earliest=$earliestTime3$ latest=$latestTime3$
    | bin _time span=5m 
    | stats dc(ecn) as ThreeWeeksAgo by _time] 
| appendcols 
    [ search index=XX sourcetype=XX earliest=$earliestTime4$ latest=$latestTime4$ 
    | bin _time span=5m 
    | stats dc(ecn) as FourWeeksAgo by _time] 
| eval ...... 
| fields .........&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$time_finder.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$time_finder.latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;format type="number" field="Diff2"&amp;gt;
          &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format type="number" field="Estimated_Impact"&amp;gt;
          &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format type="number" field="Avg_of_Diff1&amp;amp;amp;2"&amp;gt;
          &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format type="number" field="AvgOfFourWeeks_SameDay"&amp;gt;
          &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
          &amp;lt;option name="useThousandSeparators"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format type="number" field="Avg_of_Diff_of_today_to_lastweek&amp;amp;amp;Diff_of_today_to_avgOfPrior4weeks"&amp;gt;
          &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format type="number" field="Diff_of_today_to_avgOfPrior4weeks"&amp;gt;
          &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Oct 2019 20:32:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468627#M30745</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-10-23T20:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Timeinput and token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468628#M30746</link>
      <description>&lt;P&gt;Hey arjunkishore5. I did not make the properly make the changes you posted to my code, but your solution works just fine! Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 13:29:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468628#M30746</guid>
      <dc:creator>kishan2356</dc:creator>
      <dc:date>2019-10-24T13:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Timeinput and token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468629#M30747</link>
      <description>&lt;P&gt;Hey @arjunpkishore5 &lt;/P&gt;

&lt;P&gt;The dashboard works but say when I select Date &amp;amp; Range Between 11/13/2019 9:00 and 11/13/2019 10:00 what happens is that the table will display time for 8:00 to 10:00 but it fills in all the data between 8 and 9 with 0s for the first 2 columns, and than it starts to display all the data for 9 to 10. I need it to select the exact time and display it. My guess is that the issue is coming from the way the tokens are set on the dashboard? Any idea on how to fix this issue?&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;
   &amp;lt;/change&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Nov 2019 17:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Timeinput-and-token/m-p/468629#M30747</guid>
      <dc:creator>kishan2356</dc:creator>
      <dc:date>2019-11-14T17:00:03Z</dc:date>
    </item>
  </channel>
</rss>

