Dashboards & Visualizations

How to populate dropdown from lookup table?

splunkuser320
Path Finder

Hi, I need to populate the dropdown from the lookup table. I can only drop down labels from the lookup table, not the value. I need to use filter the dashboard based on the selected value. Currently, label is passing to the queries in the dashboard. 

Labels (1)
0 Karma

Manasa_401
Communicator

Hello @splunkuser320 

You have to give the lookup and table the required field you want to use as a dropdown.
In below example code, sample is the name of lookup and abc is the output field I wanted to display. So, you will get the values from abc field in the dropdown list for selection

<input type="multiselect" token="tok_name" searchWhenChanged="true">
      <label>Dropdown</label>
      <fieldForLabel>abc</fieldForLabel>
      <fieldForValue>abc</fieldForValue>
      <search>
        <query>|inputlookup sample
|table abc</query>
        <earliest>0</earliest>
        <latest></latest>
      </search>
    </input>

 

If this helps you, an upvote would be appreciated.

 

 

0 Karma

Manasa_401
Communicator

To use this dropdown selected value in dashboard query, pass the token- $tok_name$ to the SPL.

example:
|where abc="$tok_name$"

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi
If you want dropdown you should switch type="dropdown" instead of multiselect. Also I propose to use $tok_name|s$ instead of $tok_name$ to avoid issues if values have e.g. spaces. Without |s it could cause some issues with correct values. Another option for you could be to use "$tok_name$".
r. Ismo

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 ...