<?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 can we pass time from a search to time picker and all other panels? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-we-pass-time-from-a-search-to-time-picker-and-all-other/m-p/363747#M39333</link>
    <description>&lt;P&gt;Something like this maybe?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Playing Around&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true"&amp;gt;
    &amp;lt;input type="dropdown" token="t_use_time" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Found Time&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;show_time&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;use_time&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;selectFirstChoice&amp;gt;true&amp;lt;/selectFirstChoice&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| tstats latest(_time) as last where index=_internal 
| eval use_time = relative_time(last,"-4h")
| eval show_time = strftime(use_time,"%D %H:%M:%S")&amp;lt;/query&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;/search&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;eval token="form.t_time.earliest"&amp;gt;$value$&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="form.t_time.latest"&amp;gt;relative_time($value$,"+1m")&amp;lt;/eval&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="time" token="t_time" searchWhenChanged="true" depends="my_earliest"&amp;gt;
      &amp;lt;label&amp;gt;Choose Time:&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-1h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Test&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|  tstats count where index=_internal by sourcetype&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$t_time.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$t_time.latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&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;

&lt;P&gt;The dropdown is simple search to get a "peak" time.  When that dropdown changes, it sets the earliest/latest values of the timepicker accordingly - earliest is the value of the dropdown, latest is the value in the dropdown + 1 minute.  Then the panel uses the timepicker's earliest/latest value.&lt;/P&gt;</description>
    <pubDate>Sun, 02 Jul 2017 12:44:22 GMT</pubDate>
    <dc:creator>maciep</dc:creator>
    <dc:date>2017-07-02T12:44:22Z</dc:date>
    <item>
      <title>How can we pass time from a search to time picker and all other panels?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-we-pass-time-from-a-search-to-time-picker-and-all-other/m-p/363746#M39332</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We have 2 inputs&lt;BR /&gt;
1 .Input has some base search and it gives some time value(consider peak time)&lt;BR /&gt;
Ex: time value is as 03/21/2016 09:00:00  &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;2nd Input is time picker, We need to pass peaktime on to time picker as earliest time and latest time should be 1min greater than earliest time.&lt;BR /&gt;
Ex: earliesttime = 03/21/2016 09:00:00  and latesttime = earliesttime + 1min(03/21/2016 09:01:00)&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;All dashboard panels will take 2nd input as time value.&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Can someone please help us with this customization?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 14:44:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-we-pass-time-from-a-search-to-time-picker-and-all-other/m-p/363746#M39332</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2017-06-26T14:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can we pass time from a search to time picker and all other panels?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-we-pass-time-from-a-search-to-time-picker-and-all-other/m-p/363747#M39333</link>
      <description>&lt;P&gt;Something like this maybe?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Playing Around&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true"&amp;gt;
    &amp;lt;input type="dropdown" token="t_use_time" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Found Time&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;show_time&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;use_time&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;selectFirstChoice&amp;gt;true&amp;lt;/selectFirstChoice&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| tstats latest(_time) as last where index=_internal 
| eval use_time = relative_time(last,"-4h")
| eval show_time = strftime(use_time,"%D %H:%M:%S")&amp;lt;/query&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;/search&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;eval token="form.t_time.earliest"&amp;gt;$value$&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="form.t_time.latest"&amp;gt;relative_time($value$,"+1m")&amp;lt;/eval&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="time" token="t_time" searchWhenChanged="true" depends="my_earliest"&amp;gt;
      &amp;lt;label&amp;gt;Choose Time:&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-1h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Test&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|  tstats count where index=_internal by sourcetype&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$t_time.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$t_time.latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&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;

&lt;P&gt;The dropdown is simple search to get a "peak" time.  When that dropdown changes, it sets the earliest/latest values of the timepicker accordingly - earliest is the value of the dropdown, latest is the value in the dropdown + 1 minute.  Then the panel uses the timepicker's earliest/latest value.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 12:44:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-we-pass-time-from-a-search-to-time-picker-and-all-other/m-p/363747#M39333</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2017-07-02T12:44:22Z</dc:date>
    </item>
  </channel>
</rss>

