Dashboards & Visualizations

How to change search based on Dropdown?

phwork
Explorer

Hi All,

I am trying to use a drop-down to run a search based on whats selected currently (in the drop-down) in Dashboard Studio

Here is what I have so far :

  • A drop-down that's populated by an input lookup table.
  • There are 4 distinct searches.
  • Every time an item is selected in the drop-down the associated search needs to run and the data displayed needs to change.
  • The searches are very different from one another so passing a value in a $token$ will not be enough.

What can I do to show data in the form of a table based on the item selected in the drop-down ?

 

Labels (3)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @phwork,

let me understand: you have a lookup containing two columns:

  • search_title
  • search_code

you want to create a dropdown, populated with this lookup, and run the search choosed in the dropdown, is this correct?

Why do you say that "$token$ will not be enough."?

you could run something like this:

<form>
  <label>Test</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="dropdown">
      <label>Dropdown</label>
      <search>
        <query>
           | inputlookup command_lookup.csv
           | sort search_title
           | table search_title search
        </query>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </search>
      <fieldForLabel>search_title</fieldForLabel>
      <fieldForValue>search</fieldForValue>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>Test</title>
      <table>
        <search>
          <query>$dropdown$</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="count">30</option>
        <option name="drilldown">none</option>
        <option name="rowNumbers">true</option>
      </table>
    </panel>
  </row>
</form>

Ciao.

Giuseppe

0 Karma

phwork
Explorer

Hi Giuseppe,

 

Thank you for your reply.

I have a drop-down with 4 items. Each of the items has a different search associated with it. Based on what is picked in the drop-down,  a search  needs to run and display data in a a table. Also, this is in Dashboard Studio.

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @phwork,

now I'm prefering to wait to use Dashboard Studio until it will have all the features of Dashboard Classic!

Anyway, the approach I hintd is correct and runs on Classic Dashboards, try to apply to Dashboard Studio, it should run in the same way.

Ciao.

Giuseppe

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...