Dashboards & Visualizations

Enable / disable search bar in dropdown

matstap
Communicator

I have a dashboard with several dropdowns. Some of them have search bars in them and others don't, in what seems to me like a random manner. Is there an option to enable/disable the search bar in a dropdown?

alt text

alt text

0 Karma

niketn
Legend

@matstap, when you use Dynamic Option to populate choices in your Dropdown, it will have search bar. But when you have static options it will not. So one of the option to get both dropdown behavior to be similar, would be to use run anywhere Search to populate static options. Following is the search you would need to add to the first dropdown.

| makeresults
| eval data="GMT,GMT;America/Los Angeles,America/Los Angeles"
| makemv data delim=";"
| mvexpand data
| makemv data delim=","
| eval label=mvindex(data,0),value=mvindex(data,1)
| table label value

PS: I have used separate label and value values in the search so that if they differ, the same search should still work. If they are always the same your query would be simple to have just the values which will be assigned to label and value both.
On the other hand if you want to hide Search text box (which by the way is quite useful when you have your Dynamic Search return a lot of values), then you can use CSS to hide the same. I had answered that in past but no able to find the question. So, in case above does not work and you need CSS override to hide the Search box let us know.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

matstap
Communicator

In my case, the static option (time zone) resulted in a search bar and the dynamic option (State) resulted in no search bar. Anything else I can try?

0 Karma

somesoni2
Revered Legend

Can you post dashboard xml for both the dropdowns?

0 Karma

matstap
Communicator
<input type="dropdown" token="timezone" searchWhenChanged="false">
      <label>Time zone</label>
      <choice value="GMT">GMT</choice>
      <choice value="America/Los Angeles">America/Los Angeles</choice>
      <default>GMT</default>
      <initialValue>GMT</initialValue>
    </input>
    <input type="dropdown" token="state">
      <label>State</label>
      <choice value="&quot;&quot;">Select a State</choice>
      <fieldForLabel>State</fieldForLabel>
      <fieldForValue>State</fieldForValue>
      <search>
        <query>| inputlookup location_psap.csv | dedup State | fields State</query>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </search>
      <default>""</default>
      <initialValue>""</initialValue>
    </input>
0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...