<?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: SavedSearch containing $field_name$ in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/SavedSearch-containing-field-name/m-p/77853#M19692</link>
    <description>&lt;P&gt;Saved searches cannot be used to create form searches. Well, you can but you still need to use searchTemplate as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;searchTemplate&amp;gt;| savedsearch "&amp;lt;savedsearch-name&amp;gt;" name=$name$ &amp;lt;/searchTemplate&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So basically, the UI right now can only replace form inputs in a searchTemplate&lt;/P&gt;

&lt;P&gt;For more info on how to use the savedsearch command look at the manual: &lt;A href="http://www.splunk.com/base/Documentation/4.1.5/SearchReference/Savedsearch" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.5/SearchReference/Savedsearch&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2010 09:11:13 GMT</pubDate>
    <dc:creator>Ledion_Bitincka</dc:creator>
    <dc:date>2010-10-29T09:11:13Z</dc:date>
    <item>
      <title>SavedSearch containing $field_name$</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SavedSearch-containing-field-name/m-p/77852#M19691</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;I have written the following code for a form:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;form&amp;gt;

         &amp;lt;label&amp;gt;Combo box test&amp;lt;/label&amp;gt;

        &amp;lt;!-- &amp;lt;searchName&amp;gt;Test SavedSearch&amp;lt;/searchName&amp;gt; --&amp;gt;
        &amp;lt;searchTemplate&amp;gt;index="general_logs" name=$name$ | fields name type source&amp;lt;/searchTemplate&amp;gt; 

        &amp;lt;fieldset submitButton="false"&amp;gt;
            &amp;lt;input type="dropdown" token="name" searchWhenChanged="true"&amp;gt;
            &amp;lt;label&amp;gt;Name&amp;lt;/label&amp;gt;
            &amp;lt;populatingSavedSearch fieldForValue="name" fieldForLabel="name"&amp;gt;names_list&amp;lt;/populatingSavedSearch&amp;gt;
            &amp;lt;choice value="*"&amp;gt;Any&amp;lt;/choice&amp;gt;
            &amp;lt;/input&amp;gt;
            &amp;lt;/fieldset&amp;gt;


            &amp;lt;row&amp;gt;
               &amp;lt;table&amp;gt;
                  &amp;lt;title&amp;gt;Test Data&amp;lt;/title&amp;gt;
                  &amp;lt;option name="count"&amp;gt;50&amp;lt;/option&amp;gt;
                  &amp;lt;option name="showPager"&amp;gt;true&amp;lt;/option&amp;gt;
               &amp;lt;/table&amp;gt;
            &amp;lt;/row&amp;gt;

  &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At present, each time a name is selected from the dropdown list, the name selected is used to automatically run the search inside the searchTemplate tags.  &lt;/P&gt;

&lt;P&gt;I tried to use a scheduled saved search (which is identical to the search in the searchTemplate tags) to achieve the same results (see commented out searchName tags in code above) but it does not produce the same results when I choose a name from my dropdown list. I don't think that the field $name$ in my saved search is being populated with the data selected in my dropdown list. How can I get this to work? &lt;/P&gt;

&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2010 23:47:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SavedSearch-containing-field-name/m-p/77852#M19691</guid>
      <dc:creator>Ant1D</dc:creator>
      <dc:date>2010-10-26T23:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: SavedSearch containing $field_name$</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SavedSearch-containing-field-name/m-p/77853#M19692</link>
      <description>&lt;P&gt;Saved searches cannot be used to create form searches. Well, you can but you still need to use searchTemplate as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;searchTemplate&amp;gt;| savedsearch "&amp;lt;savedsearch-name&amp;gt;" name=$name$ &amp;lt;/searchTemplate&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So basically, the UI right now can only replace form inputs in a searchTemplate&lt;/P&gt;

&lt;P&gt;For more info on how to use the savedsearch command look at the manual: &lt;A href="http://www.splunk.com/base/Documentation/4.1.5/SearchReference/Savedsearch" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.5/SearchReference/Savedsearch&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2010 09:11:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SavedSearch-containing-field-name/m-p/77853#M19692</guid>
      <dc:creator>Ledion_Bitincka</dc:creator>
      <dc:date>2010-10-29T09:11:13Z</dc:date>
    </item>
  </channel>
</rss>

