<?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 pass lookup field values to the time range? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475375#M31225</link>
    <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/SearchTimeModifiers#4._Search_with_an_exact_date_as_a_boundary"&gt;SearchTimeModifiers&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;@manjunathmeti , yes.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup your_csv
| eval query="(earliest=".earliest." "."latest=".latest.")"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's OK.&lt;/P&gt;</description>
    <pubDate>Sat, 22 Feb 2020 06:37:17 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-02-22T06:37:17Z</dc:date>
    <item>
      <title>How to pass lookup field values to the time range?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475372#M31222</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a lookup file which has fields Month, earliest, latest. I have drop down name "Month" which gives me the list of all the months from the lookup table. When I choose a month from the drop down the respective values of the earliest and the latest should be passed to the searches or time range token in the dashboard.&lt;/P&gt;

&lt;P&gt;Month               earliest                             latest&lt;BR /&gt;
Jan         01/15/2020:03:34:45           01/15/2020:05:34:45&lt;BR /&gt;
Feb        02/15/2020:03:34:45           02/15/2020:01:34:45&lt;BR /&gt;
Mar       03/15/2020:03:34:45           03/15/2020:07:34"45&lt;BR /&gt;
Apr        04/15/2020:03:34:45           04/15/2020:08:34:45&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 01:51:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475372#M31222</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2020-02-22T01:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass lookup field values to the time range?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475373#M31223</link>
      <description>&lt;P&gt;SAMPLE:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;lookup to time&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="timepicker" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;time piker&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;Month&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;query&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| makeresults 
| eval _raw="Month earliest latest
Jan 01/15/2020:03:34:45 01/15/2020:05:34:45
Feb 02/15/2020:03:34:45 02/15/2020:01:34:45
Mar 03/15/2020:03:34:45 03/15/2020:07:34:45
Apr 04/15/2020:03:34:45 04/15/2020:08:34:45"
| multikv forceheader=1
| table Month earliest latest
| foreach *est [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = round(strptime(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;,"%m/%d/%Y:%T"))]
| eval query="(earliest=".earliest." "."latest=".latest.")"&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;token value: $timepicker$&amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;event&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal $timepicker$&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="list.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/event&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;recommend:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="timepicker" searchWhenChanged="true"&amp;gt;
   &amp;lt;label&amp;gt;time piker&amp;lt;/label&amp;gt;
   &amp;lt;fieldForLabel&amp;gt;Month&amp;lt;/fieldForLabel&amp;gt;
   &amp;lt;fieldForValue&amp;gt;query&amp;lt;/fieldForValue&amp;gt;
   &amp;lt;search&amp;gt;
     &amp;lt;query&amp;gt;| inputlookup your_csv
| foreach *est [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = round(strptime(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;,"%m/%d/%Y:%T"))]
| eval query="(earliest=".earliest." "."latest=".latest.")"&amp;lt;/query&amp;gt;
     &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
     &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
   &amp;lt;/search&amp;gt;
 &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;please put the token &lt;CODE&gt;$timepicker$&lt;/CODE&gt; to your main search.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 05:00:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475373#M31223</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-22T05:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass lookup field values to the time range?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475374#M31224</link>
      <description>&lt;P&gt;Just thought of sharing this. If date time values are in timeformat %m/%d/%Y:%H:%M:%S, then you can search earliest and latest with them directly. So below query also works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal earliest="02/21/2020:05:00:00" latest="02/21/2020:05:05:00"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Feb 2020 05:35:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475374#M31224</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-02-22T05:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass lookup field values to the time range?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475375#M31225</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/SearchTimeModifiers#4._Search_with_an_exact_date_as_a_boundary"&gt;SearchTimeModifiers&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;@manjunathmeti , yes.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup your_csv
| eval query="(earliest=".earliest." "."latest=".latest.")"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's OK.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 06:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475375#M31225</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-22T06:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass lookup field values to the time range?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475376#M31226</link>
      <description>&lt;P&gt;@to4kawa Thank you! It worked..&lt;BR /&gt;
But I wanted to use the result of the query to change the token using eval. But it's not working.&lt;BR /&gt;
I need to check a specific value of the earliest from the result. If it matches then I need to use the token and assign some other value to it.&lt;BR /&gt;
The token value is not getting effected in the panel. Can you help me on this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="dropdown" token="timepicker" searchWhenChanged="true"&amp;gt;
       &amp;lt;label&amp;gt;time piker&amp;lt;/label&amp;gt;
       &amp;lt;fieldForLabel&amp;gt;Month&amp;lt;/fieldForLabel&amp;gt;
       &amp;lt;fieldForValue&amp;gt;query&amp;lt;/fieldForValue&amp;gt;
       &amp;lt;search&amp;gt;
         &amp;lt;query&amp;gt;| inputlookup sample_file
 | foreach *est [ eval &amp;amp;lt;&amp;amp;lt;FIELD&amp;amp;gt;&amp;amp;gt; = round(strptime(&amp;amp;lt;&amp;amp;lt;FIELD&amp;amp;gt;&amp;amp;gt;,"%m/%d/%Y:%T"))]
 | eval query="(earliest=".earliest." "."latest=".latest.")"
         &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
         &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
       &amp;lt;/search&amp;gt;
       &amp;lt;change&amp;gt;
        &amp;lt;eval token="abc"&amp;gt;if('query.earliest'= 1577817000, (earliest=1577817000 latest=15777903400), (earliest=1577817000 latest=15777903405))&amp;lt;/eval&amp;gt;
        &amp;lt;/change&amp;gt;
     &amp;lt;/input&amp;gt;
     &amp;lt;panel&amp;gt;
       &amp;lt;html&amp;gt;token value: $timepicker$ $abc$&amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Feb 2020 18:29:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475376#M31226</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2020-02-22T18:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass lookup field values to the time range?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475377#M31227</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;change&amp;gt;
    &amp;lt;eval token="abc"&amp;gt;if(mvindex(split($timepicker$,"="),1) = 1577817000,"(earliest=1577817000 latest=1577903400)", "(earliest=1577817000 latest=1577903405)")&amp;lt;/eval&amp;gt;
  &amp;lt;/change&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;query.earliest&lt;/EM&gt; is nothing.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 21:35:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-lookup-field-values-to-the-time-range/m-p/475377#M31227</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-22T21:35:54Z</dc:date>
    </item>
  </channel>
</rss>

