Dashboards & Visualizations

How to add a drop-down to populate a HiddenSearch module in advanced XML?

Communicator

I tried adding a drop-down in advanced XML, but i am not able to populate the result using the drop-down. I have a HiddenSearch module and HiddenPostProcess Search. I tried adding the StaticSelect module before the search, but i am getting the error :

"This view has a Splunk.Module.HiddenSearch module but it is configured with no child modules to push its changes to. This represents a configuration error"

Any one have advice on how to include drop-down value in a search in advanced XML?

<!--
<module name="StaticSelect" layoutPanel="mainSearchControls">
<param name="settingToCreate">Filter Result</param>
<param name="label">Select</param>
<param name="selected">Choice 1/param>
<param name="searchWhenChanged">True</param>
<param name="staticFieldsToDisplay">
<list> 
<param name="label">Choice 1</param> 
<param name="value">tag=1</param> 
</list> 
<list> 
<param name="label">Choice 2</param> 
<param name="value">tag=2</param> 
</list> 
<list> 
<param name="label">Choice 3</param> 
<param name="value">tag=3</param> 
</list> 
<list> 
<param name="label">Choice 4</param> 
<param name="value">tag=4/param> 
</list>
<list>
<param name="label">Choice 5</param> 
<param name="value">tag=5</param> 
</list>
<list> 
<param name="label">Choice 6</param> 
<param name="value">*</param> 
</list>
</param>

<module name="ConvertToIntention"> 
<param name="settingToConvert">Filter Result</param> 
<param name="intention">
<param name="name">stringreplace</param>
<param name="arg"> 
<param name="Select">
<param name="value">$target$</param>
</param>
</param>
</param>

<module name="HiddenSearch" layoutPanel="panel_row2_col1" autoRun="True">
<param name="search">index=foo $Select$ |stats count by User_Name
     </module>
  </module>
     </module>
     .........


     //-->
0 Karma

Motivator

Hi Kartik
Try this code :

  <view onunloadCancelJobs="False" autoCancelInterval="100">
        <!-- autoCancelInterval is set here to 100 -->
        <label>Sample search</label>
        <module name="AccountBar" layoutPanel="appHeader"/>
        <module name="AppBar" layoutPanel="navigationHeader"/>
        <module name="Message" layoutPanel="messaging">
        <param name="filter"></param>
        <param name="clearOnJobDispatch">False</param>
        <param name="maxSize">1</param>
        </module>
        <module name="HiddenSearch" layoutPanel="mainSearchControls">
        <param name="search"> index=foo $Select$ |stats count by User_Name</param>
        <param name="earliest">0</param>
        <param name="latest">now</param>
        <module name="StaticSelect">
        <param name="settingToCreate">Filter Result</param>
        <param name="label">Select</param>
        <param name="staticFieldsToDisplay">
        <list>
        <param name="label">Choice 1</param>
        <param name="value">tag=1</param>
        </list>
        <list>
        <param name="label">Choice 2</param>
        <param name="value">tag=2</param>
        </list>
        <list>
        <param name="label">Choice 3</param>
        <param name="value">tag=3</param>
        </list>
        <list>
        <param name="label">Choice 4</param>
        <param name="value">tag=4/param>
        </list>
        <list>
        <param name="label">Choice 5</param>
        <param name="value">tag=5</param>
        </list>
        <list>
        <param name="label">Choice 6</param>
        <param name="value">*</param>
        </list>
        </param>
        <module name="ConvertToIntention">
        <param name="settingToConvert">Filter Result</param>
        <param name="intention">
        <param name="name">addterm</param>
        <param name="arg">
        <param name="Select">$Select$</param>
        </param>
        </param>
        </module>
        </module>
        </module>
        </view>
0 Karma

Communicator
<module name="ConvertToIntention">
         <param name="settingToConvert">Filter Result</param>
         <param name="intention">
         <param name="name">addterm</param>
         <param name="arg">
         <param name="Select">$Select$</param>

in this stanza when i add the term it is showing me the value but in the dropdown i am using tag which cannot be used after pipes any suggestions

0 Karma

Communicator

Hi kartik
i try something with two dropdown i thank it may help you

<module name="StaticSelect">
  <param name="settingToCreate">area</param>
  <param name="label">Country</param>
  <param name="staticFieldsToDisplay">
    <list>
      <param name="label">USA</param>
      <param name="value">USA</param>
    </list>
    <list>
      <param name="label">Japan</param>
    <param name="value">Japan</param>
    </list>
    <list>
      <param name="label">China</param>
      <param name="value">China</param>
    </list>
    <list>
      <param name="label">Germany</param>
      <param name="value">Germany</param>
    </list>
  </param>
    <module name="ConvertToIntention">
      <param name="settingToConvert">area</param>
      <param name="intention">
        <param name="name">addterm</param>
        <param name="arg">
          <param name="area">$target$</param>
        </param>
      </param>
      <module name="SearchSelectLister">
        <param name="settingToCreate">pref</param>
        <param name="label">City</param>
        <param name="applyOuterIntentionsToInternalSearch">True</param>
        <param name="search">| inputlookup citylookup</param>
        <param name="searchFieldsToDisplay">
          <list>
            <param name="label">city</param>
            <param name="value">city</param>
          </list>
        </param>
         <module name="ConvertToIntention">
           <param name="settingToConvert">pref</param>
           <param name="intention">
             <param name="name">addterm</param>
             <param name="arg">
               <param name="pref">$target$</param>
             </param>
           </param>
         </module> <!-- End ConvertToIntention -->
         . . .
      </module> <!-- End SearchSelectLister -->
    </module> <!-- End ConvertToIntention -->
</module> <!-- End StaticSelect -->
0 Karma

Communicator

Hi kartik 13
i am not sure it can work HiddenSearch module but i try something with
SearchSelectLister module. it work just add above code to this xml code it work with Searchseleclister

<module name="SearchSelectLister">
      <param name="settingToCreate">pref</param>
      <param name="label">City</param>
      <param name="applyOuterIntentionsToInternalSearch">True</param>
      <param name="search">| inputlookup myLookup2</param>
      <param name="searchFieldsToDisplay">
        <list>
         <param name="label">city</param>
         <param name="value">city</param>
        </list>
0 Karma

Communicator

i guess this is for when i am popping the dropdown meunu from the search of the lookup ..

0 Karma

Communicator

also

 <module name="ConvertToIntention">
            <param name="settingToConvert">pref</param>
            <param name="intention">
              <param name="name">addterm</param>
              <param name="arg">
                <param name="pref">$target$</param>
              </param>
            </param>

in this stanza when i add the term it is showing me the value but in the dropdown i am using tag which cannot be used after pipes any suggestions

0 Karma

Hi kartik13,
Try to add a child module ExtendedFieldSearch like folllow in example:

<module name="HiddenSearch" layoutPanel="panel_row2_col1" autoRun="True">
 <param name="search">index=foo $Select$ |stats count by User_Name
    <module name="ExtendedFieldSearch">
      <param name="field">Select</param>
      <param name="intention">
        <param name="name">stringreplace</param>
        <param name="arg">
            <param name="Select">
                <param name="value"></param>
            </param>
        </param>
      </param>
      <param name="replacementMap">
        <param name="arg">
          <param name="File">
              <param name="value"></param>
          </param>
        </param>
      </param>
</module>
0 Karma

Communicator

How can i add dropdown options in it?

0 Karma

Look code example that follow:

 <module name="HiddenSearch" layoutPanel="mainSearchControls">
   <param name="search">host="Laura-PC" Requester="$Requester$" | stats $st$</param>

   <module name="StaticSelect" layoutPanel="mainSearchControls">
 <param name="settingToCreate">Filter Result</param>
 <param name="label">Select</param>
 <param name="selected">Choice 1/param>
 <param name="searchWhenChanged">True</param>
 <param name="staticFieldsToDisplay">
 <list> 
 <param name="label">Choice 1</param> 
 <param name="value">tag=1</param> 
 </list> 
 <list> 
 <param name="label">Choice 2</param> 
 <param name="value">tag=2</param> 
 </list> 
 <list> 
 <param name="label">Choice 3</param> 
 <param name="value">tag=3</param> 
 </list> 
 <list> 
 <param name="label">Choice 4</param> 
 <param name="value">tag=4/param> 
 </list>
 <list>
 <param name="label">Choice 5</param> 
 <param name="value">tag=5</param> 
 </list>
 <list> 
 <param name="label">Choice 6</param> 
 <param name="value">*</param> 
 </list>
 </param>

 <module name="ConvertToIntention"> 
 <param name="settingToConvert">Filter Result</param> 
 <param name="intention">
 <param name="name">stringreplace</param>
 <param name="arg"> 
 <param name="Select">
 <param name="value">$target$</param>
 </param>
 </param>
 </param>

       <module name="ExtendedFieldSearch">
         <param name="intention">
           <param name="name">stringreplace</param>
           <param name="arg">
               <param name="st">
                   <param name="default">count</param>
                   <param name="value"></param>
               </param>
           </param>
         </param> <!-- End param intention-->
         <param name="replacementMap">
           <param name="arg">
             <param name="st">
                 <param name="value"></param>
             </param>
           </param>
         </param> <!-- End param replacementMap -->
         <param name="field">Param</param>

         <module name="EventsViewer" layoutPanel="resultsAreaLeft">
           <param name="segmentation">full</param>
         </module>
       </module>
     </module>
   </module> 
 </module>
0 Karma

Motivator

Hi kartik
Try with this Advanced xml code

<view onunloadCancelJobs="False" autoCancelInterval="100">
            <!-- autoCancelInterval is set here to 100 -->
            <label>Sample search</label>
            <module name="AccountBar" layoutPanel="appHeader"/>
            <module name="AppBar" layoutPanel="navigationHeader"/>
            <module name="Message" layoutPanel="messaging">
            <param name="filter"></param>
            <param name="clearOnJobDispatch">False</param>
            <param name="maxSize">1</param>
            </module>
            <module name="HiddenSearch" layoutPanel="mainSearchControls">
            <param name="search"> index=foo $Select$ |stats count by User_Name</param>
            <param name="earliest">-2m</param>
            <param name="latest">-0m</param>
            <module name="StaticSelect">
            <param name="settingToCreate">Filter Result</param>
            <param name="label">Filter</param>
            <param name="staticFieldsToDisplay">
           <list>
    <param name="label">Choice 1</param>
    <param name="value">tag=1</param>
    </list>
    <list>
    <param name="label">Choice 2</param>
    <param name="value">tag=2</param>
    </list>
    <list>
    <param name="label">Choice 3</param>
    <param name="value">tag=3</param>
    </list>
    <list>
    <param name="label">Choice 4</param>
    <param name="value">tag=4/param>
    </list>
    <list>
    <param name="label">Choice 5</param>
    <param name="value">tag=5</param>
    </list>
    <list>
    <param name="label">Choice 6</param>
    <param name="value">*</param>
    </list>
    </param>

            <module name="ConvertToIntention">
            <param name="settingToConvert">Filter Result</param>
            <param name="intention">
            <param name="name">addterm</param>
            <param name="arg">
            <param name="Select">$Select$</param>
            </param>
            </param>
            </module>
            </module>
            <module name="ServerSideInclude" >
            <param name="src">filtered_map.html</param>
            </module>
            </module>
            </view>
0 Karma

Communicator

Still not working This time its showing "ServerSideInclude Module Error! "

0 Karma

Motivator

Kartik
Go to the advance xml code and delete the following

<module name="ServerSideInclude" >
<param name="src">filtered_map.html</param>
</module>

then re-run

0 Karma
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!