<?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 Passing variable to populatingSearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Passing-variable-to-populatingSearch/m-p/157896#M185815</link>
    <description>&lt;P&gt;This is what I am trying to do:&lt;BR /&gt;
I have a time range drop down which will provide value to a dynamic populated drop down. I have tried the following but it fail saying "Invalid value "$earliest$" for time term 'earliest'"&lt;/P&gt;

&lt;P&gt;{code}&lt;/P&gt;

&lt;P&gt;&lt;INPUT type="dropdown" searchwhenchanged="true" token="earliest" /&gt;&lt;BR /&gt;
      &lt;CHOICE value="-2d@d"&gt;2 days&lt;/CHOICE&gt;&lt;BR /&gt;
      &lt;CHOICE value="-3d@d"&gt;3 days&lt;/CHOICE&gt;&lt;BR /&gt;
    &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="id"&amp;gt;
  &amp;lt;label&amp;gt;ID&amp;lt;/label&amp;gt;
  &amp;lt;populatingSearch fieldForValue="ID" fieldForLabel="ID"&amp;gt;
  &amp;lt;![CDATA[search index=login sourcetype=login_logs earliest="$earliest$" | dedup 1 ID]]&amp;gt;
  &amp;lt;/populatingSearch&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;{code}&lt;/P&gt;

&lt;P&gt;If I provide a string value as earliest="-2d@d" it works. But I want the drop down to populate the value in search string. Is it possible to earliest as:&lt;BR /&gt;
&lt;POPULATINGSEARCH fieldforvalue="ID" fieldforlabel="ID" earliest="$earliest$"&gt; as argument?&lt;/POPULATINGSEARCH&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 May 2014 22:49:55 GMT</pubDate>
    <dc:creator>anujojha</dc:creator>
    <dc:date>2014-05-08T22:49:55Z</dc:date>
    <item>
      <title>Passing variable to populatingSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-variable-to-populatingSearch/m-p/157896#M185815</link>
      <description>&lt;P&gt;This is what I am trying to do:&lt;BR /&gt;
I have a time range drop down which will provide value to a dynamic populated drop down. I have tried the following but it fail saying "Invalid value "$earliest$" for time term 'earliest'"&lt;/P&gt;

&lt;P&gt;{code}&lt;/P&gt;

&lt;P&gt;&lt;INPUT type="dropdown" searchwhenchanged="true" token="earliest" /&gt;&lt;BR /&gt;
      &lt;CHOICE value="-2d@d"&gt;2 days&lt;/CHOICE&gt;&lt;BR /&gt;
      &lt;CHOICE value="-3d@d"&gt;3 days&lt;/CHOICE&gt;&lt;BR /&gt;
    &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="id"&amp;gt;
  &amp;lt;label&amp;gt;ID&amp;lt;/label&amp;gt;
  &amp;lt;populatingSearch fieldForValue="ID" fieldForLabel="ID"&amp;gt;
  &amp;lt;![CDATA[search index=login sourcetype=login_logs earliest="$earliest$" | dedup 1 ID]]&amp;gt;
  &amp;lt;/populatingSearch&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;{code}&lt;/P&gt;

&lt;P&gt;If I provide a string value as earliest="-2d@d" it works. But I want the drop down to populate the value in search string. Is it possible to earliest as:&lt;BR /&gt;
&lt;POPULATINGSEARCH fieldforvalue="ID" fieldforlabel="ID" earliest="$earliest$"&gt; as argument?&lt;/POPULATINGSEARCH&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2014 22:49:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-variable-to-populatingSearch/m-p/157896#M185815</guid>
      <dc:creator>anujojha</dc:creator>
      <dc:date>2014-05-08T22:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable to populatingSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-variable-to-populatingSearch/m-p/157897#M185816</link>
      <description>&lt;P&gt;I think you are close, what if you do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" searchwhenchanged="true" token="earliest"&amp;gt;
      &amp;lt;choice value="-2d@d"&amp;gt;2 days&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="-3d@d"&amp;gt;3 days&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;

&amp;lt;input type="dropdown" token="id"&amp;gt;
  &amp;lt;label&amp;gt;ID&amp;lt;/label&amp;gt;
  &amp;lt;populatingSearch fieldForValue="ID" fieldForLabel="ID"&amp;gt;
      &amp;lt;![CDATA[search index=login sourcetype=login_logs| dedup 1 ID]]&amp;gt;
      &amp;lt;earliestTime&amp;gt;$earliest$&amp;lt;/earliestTime&amp;gt;
  &amp;lt;/populatingSearch&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Notice that I moved the &lt;CODE&gt;$earliest$&lt;/CODE&gt; token from within the populating search and into a separate tag.&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2014 23:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-variable-to-populatingSearch/m-p/157897#M185816</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-05-08T23:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable to populatingSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-variable-to-populatingSearch/m-p/157898#M185817</link>
      <description>&lt;P&gt;If I use  &lt;EARLIESTTIME&gt; tag then it does not uses the days provided from drop down it take default days.&lt;/EARLIESTTIME&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2014 00:15:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-variable-to-populatingSearch/m-p/157898#M185817</guid>
      <dc:creator>anujojha</dc:creator>
      <dc:date>2014-05-09T00:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable to populatingSearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-variable-to-populatingSearch/m-p/157899#M185818</link>
      <description>&lt;P&gt;If I use  &lt;EARLIESTTIME&gt; tag then it does not uses the days provided from drop down it take default days.&lt;/EARLIESTTIME&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2014 00:15:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-variable-to-populatingSearch/m-p/157899#M185818</guid>
      <dc:creator>anujojha</dc:creator>
      <dc:date>2014-05-09T00:15:53Z</dc:date>
    </item>
  </channel>
</rss>

