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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...