Splunk Search

How to create a dynamic dropdown based on token value?

sjs
Path Finder

Hey people,

Here is what I am trying to do:

- I have two dashboards, dashboardA & dashboardB

- I am sending a token value from dashboardA -> dashboardB

- Inside dashboardB, I want to create a dynamic dropdown based on token value

 

This is how my dropdown should look like:

- lets say the token value is 10, I want to display choices from 1 to 10 in the dropdown

 

My thinking was to do something like this:

 

 

<input type="dropdown" token="subrack_No">
 <choice value="*">All</choice>
  <search>
    <query> | makeresults | "some command which generates data from 1 to token value" </query>
   </search>
<default>1</default>

 

 

 

Could you please help me here

Labels (2)
Tags (1)
0 Karma

sjs
Path Finder

Hey @gcusello , I think I made little complex let's forget about passing the token from one dashboard to other.

 

My actual question was can we create a drop dynamically

For example 

<dropdown menu>
    iteratively add elements to the menu from 1 to n
</dropdown menu>

 

Is it possible for me to do this?

0 Karma

gcusello
SplunkTrust
SplunkTrust

HI @sjs,

what's your requirement: do you want to pass a search from a dashboard to another or having a dynamic menu?

sorry but It isn't so clear, could you better describe your need?

Anyway, if you want to pass a search from a dashboard to another, my anser should run.

Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @sjs,

the problem isn't to pass a searh from a Dashboard to another because you can pass the full search as a token:

<input type="dropdown" token="subrack_No">
 <choice value="*">All</choice>
  <search>
    <query>
        $search_token_from_dashboardA$
    </query>
   </search>
   <default>*</default>
</input>

the problem is that there are other information used in the drilldown to pass in the drilldown link in DashboardA

<drilldown>
  <link>
    <![CDATA[DashboardB?search_token=index=_internal | table index sourcetype source $&amp;TimeFrom=$Time.earliest$&amp;TimeTo=$Time.latest$&amp;field_token=sourcetype]>
  </link>
</drilldown>

to use in the input:

<input type="dropdown" token="subrack_No">
 <choice value="*">All</choice>
  <search>
    <query>
        $search_token$
    </query>
    <earliest>$TimeFrom$</earliest>
    <latest>$TimeTo$</latest>
   </search>
   <fieldForLabel>$field_token$</fieldForLabel>
   <fieldForValue>$field_token$</fieldForValue>
   <prefix>$field$="</prefix>
   <suffix>"</suffix>
   <default>*</default>
</input>

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!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...