<?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 to update timepicker on another input change in dashboard in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502168#M32901</link>
    <description>&lt;P&gt;What you need to do is create an base search that is not embedded in a panel that has some thing like this SPL &lt;CODE&gt;| inputlookup lookup.csv | stats min(from) AS from max(to) AS to&lt;/CODE&gt; (perhaps with the &lt;CODE&gt;lookup.csv&lt;/CODE&gt; being a token matching the name of the lookup selected from another field).  Then set the token in the &lt;CODE&gt;change&lt;/CODE&gt; section like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;change&amp;gt;
   &amp;lt;eval token="timerange.earliest"&amp;gt;from&amp;lt;/eval&amp;gt;
   &amp;lt;eval token="timerange.latest"&amp;gt;to&amp;lt;/eval&amp;gt;
&amp;lt;/change&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Oct 2019 22:21:47 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-10-16T22:21:47Z</dc:date>
    <item>
      <title>How to update timepicker on another input change in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502166#M32899</link>
      <description>&lt;P&gt;I have a dashboard with 2 inputs fields&lt;BR /&gt;
* a dropdown to choose a lookup file&lt;BR /&gt;
* a timepicker (token=timerange)&lt;/P&gt;

&lt;P&gt;Is it possible to update the timepicker tokens (earliest and latest) when i update the dropdown value? and if yes, the process:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;I select a lookup file on the dropdown list&lt;/LI&gt;
&lt;LI&gt;The lookup file contains 2 timestamps fields i want to use&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Sample of the lookup file:&lt;/P&gt;

&lt;P&gt;value,from,to&lt;BR /&gt;
something,timestamp1,timestamp2&lt;/P&gt;

&lt;P&gt;I try to add this to input in simplexml dashboard on dropdown declaration:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;change&amp;gt;
&amp;lt;eval token="timerange.earliest"&amp;gt;[| inputlookup lookup.csv | stats min(from) as from | return $from ]&amp;lt;/eval&amp;gt;
&amp;lt;eval token="timerange.latest"&amp;gt;[| inputlookup lookup.csv | stats max(to) as to | return $to ]&amp;lt;/eval&amp;gt;
&amp;lt;/change&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;without any results ...&lt;/P&gt;

&lt;P&gt;I also tried to make a small js file to attach on dropdown change event....no success here&lt;/P&gt;

&lt;P&gt;If you have an idea...&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 19:01:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502166#M32899</guid>
      <dc:creator>C_HIEN</dc:creator>
      <dc:date>2019-10-15T19:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to update timepicker on another input change in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502167#M32900</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;change&amp;gt;
 &amp;lt;eval token="timerange.earliest"&amp;gt;[| inputlookup lookup.csv |output from | dedup from | sort from | head 1]&amp;lt;/eval&amp;gt;
 &amp;lt;eval token="timerange.latest"&amp;gt;[| inputlookup lookup.csv |output from | dedup to | sort -to | head 1 ]&amp;lt;/eval&amp;gt;
 &amp;lt;/change&amp;gt;

&amp;lt;set token="timerange.earliest"&amp;gt;$result.from$&amp;lt;/set&amp;gt; 
&amp;lt;set token="timerange.latest"&amp;gt;$result.to$&amp;lt;/set&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Set those values to tokens something like above should work.&lt;BR /&gt;
Hope this helps, Please let me know if you have any questions.Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 19:39:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502167#M32900</guid>
      <dc:creator>sandeepmakkena</dc:creator>
      <dc:date>2019-10-15T19:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to update timepicker on another input change in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502168#M32901</link>
      <description>&lt;P&gt;What you need to do is create an base search that is not embedded in a panel that has some thing like this SPL &lt;CODE&gt;| inputlookup lookup.csv | stats min(from) AS from max(to) AS to&lt;/CODE&gt; (perhaps with the &lt;CODE&gt;lookup.csv&lt;/CODE&gt; being a token matching the name of the lookup selected from another field).  Then set the token in the &lt;CODE&gt;change&lt;/CODE&gt; section like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;change&amp;gt;
   &amp;lt;eval token="timerange.earliest"&amp;gt;from&amp;lt;/eval&amp;gt;
   &amp;lt;eval token="timerange.latest"&amp;gt;to&amp;lt;/eval&amp;gt;
&amp;lt;/change&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2019 22:21:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502168#M32901</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-10-16T22:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to update timepicker on another input change in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502169#M32902</link>
      <description>&lt;P&gt;Thanks for your answer but i don't understand where i have to put both &lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 12:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502169#M32902</guid>
      <dc:creator>C_HIEN</dc:creator>
      <dc:date>2019-10-17T12:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to update timepicker on another input change in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502170#M32903</link>
      <description>&lt;P&gt;Thanks for your answer ! It was a great idea and l've finally a working result.&lt;/P&gt;

&lt;P&gt;As you said i have defined a base search which depends of a token $lookup$.&lt;BR /&gt;
In the search definition i've added a condition to be sure it returns results and then eval timerange.earliest and timerange.latest tokens ( eval of form.timerange.earliest and form.timerange.latest refresh timepicker content ...nice!)&lt;/P&gt;

&lt;P&gt;I've checked "run search on change" for the dropdown list i use to select the lookup.&lt;/P&gt;

&lt;P&gt;And the magic happens !&lt;/P&gt;

&lt;P&gt;PS: I will update this post with my dashboard source&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 18:32:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502170#M32903</guid>
      <dc:creator>C_HIEN</dc:creator>
      <dc:date>2019-10-17T18:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to update timepicker on another input change in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502171#M32904</link>
      <description>&lt;P&gt;Yes, please do post it as a folloup here so this is a wholly complete answer.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 19:23:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-update-timepicker-on-another-input-change-in-dashboard/m-p/502171#M32904</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-10-18T19:23:16Z</dc:date>
    </item>
  </channel>
</rss>

