Dashboards & Visualizations

convert dynamic drop-down to static in advanced xml

mikefoti
Communicator

In an effort to answer my own question
(posted here: http://splunk-base.splunk.com/answers/51394/convert-dynamic-drop-down-to-static)
I converted my simple form to advanced xml then attempted to replace code for the SearchSelectLister module with code for the StaticSelect module.
I replaced THIS CODE:

  <module name="SearchSelectLister" layoutPanel="viewHeader" autoRun="True">
<param name="staticFieldsToDisplay">
  <list>
    <param name="value">*</param>
    <param name="label">ALL</param>
  </list>
</param>
<param name="search">index=winradius_ow | stats count by nps_storeNumber</param>
<param name="selected">*</param>
<param name="label">Select a location</param>
<param name="settingToCreate">nps_storeNumber_setting</param>
<param name="searchFieldsToDisplay">
  <list>
    <param name="value">nps_storeNumber</param>
    <param name="label">nps_storeNumber</param>
  </list>
</param>
<param name="searchWhenChanged">False</param>
<module name="ConvertToIntention">
  <param name="settingToConvert">nps_storeNumber_setting</param>

WITH THIS CODE:

  <module name="StaticSelect">
<param name="settingToCreate">nps_storeNumber_setting</param>
<param name="label">Select a location</param>
<param name="staticFieldsToDisplay">
       <list>
            <param name="value">GMD</param>
            <param name="label">PickGMD</param>
       </list>
</param>
<param name="searchWhenChanged">False</param>


<module name="ConvertToIntention">

Any help deciphering the resulting error message would be appreciated:

Exception: Splunk cannot load the specified view because a layoutPanel is not defined for module StaticSelect_0_0_0.

0 Karma
1 Solution

Ayn
Legend

The error message really says what the problem is: you're putting a SearchSelectLister in your view, but Splunk has no idea about where to put it unless you say where you want it. I don't know enough about the details of your view so I don't know where you want the lister, but the code that you replaced had the lister defined with layoutPanel="viewHeader" so you likely want the same in the new code. So:

<module name="StaticSelect" layoutPanel="viewHeader">
...

View solution in original post

0 Karma

Ayn
Legend

The error message really says what the problem is: you're putting a SearchSelectLister in your view, but Splunk has no idea about where to put it unless you say where you want it. I don't know enough about the details of your view so I don't know where you want the lister, but the code that you replaced had the lister defined with layoutPanel="viewHeader" so you likely want the same in the new code. So:

<module name="StaticSelect" layoutPanel="viewHeader">
...
0 Karma

mikefoti
Communicator

Wow, you made that look easy! Thanks for your help... works perfectly now.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...