Dashboards & Visualizations

How to create dependencies in dropdown menu to show limited information when using multiple dropdowns

Motivator

Hello

I am trying to create multiple dropdowns in Splunk and the 2nd drop down should be dependent upon the information given in the first drop down as few things have recently changed in the company.

The code which I currently have is

<fieldset autoRun="false">
<input type="dropdown" token="Dept">
  <label>Department: </label>
  <default>*</default>
  <choice value="*">All</choice>
  <choice value="Systems">Systems</choice>
  <choice value="Agency">Agency</choice>
</input>

<input type="dropdown" token="Area">
  <label>Area: </label>
  <default>*</default>
  <choice value="*">All</choice>
  <choice value="Architecture and Engineering">Architecture and Engineering</choice>
  <choice value="Systems Technology">Systems Technology</choice>
  <choice value="Product Solutions">Product Solutions</choice>
  <choice value="Systems Projects">Systems Projects</choice>
  <choice value="Customer Connection Solutions">Customer Connection Solutions</choice>
  <choice value="Channel Support">Channel Support</choice>
  <choice value="General and Financial Services">General and Financial Services</choice>
  <choice value="Data &amp; Information Strategies">Data  and amp; Information Strategies</choice>
  <choice value="P&amp;C Claims Systems">P and amp;C Claims Systems</choice>
  <choice value="Customer Relationship Management">Customer Relationship Management</choice>
  <choice value="Not Defined">Not Defined</choice>
  <choice value="Product Solutions">Product Solutions</choice>
</input>
<input type="text" token="WG">
  <label>WorkGroup: </label>
  <default>*</default>
</input>

What I want to do is if a user selects "Agency" in the first dropdown box then he should be shown only "Not defined" option in the 2nd drop down box rather than showing all the areas. Any idea on how to do it.

Also, I have a search box listed in the fieldset. I was wondering if there is any way to prioritize the searches over the dropdown box. I mean to say, if a user (Business Analyst) give a Worgroup as 1234 then irrespective of what's listed in the dropdown boxes the output has to be of that WG. Any idea if this would be possible?

Regards

theou

Tags (1)

Path Finder

Hallo theou,

Have you thought to use dynamic option to populating second dropdown? Because when I want filter which second dropdown should be shown, after create the populating search to second dropdown, I add the token from first dropdown to filter the search. If you are using splunk 6.1 or more, you can found an exemple:

<fieldset autoRun="false">
 <input type="dropdown" token="Dept">
   <label>Department: </label>
   <default>*</default>
   <choice value="*">All</choice>
   <choice value="Systems">Systems</choice>
   <choice value="Agency">Agency</choice>
 </input>


<input type="dropdown" token="Area" searchWhenChanged="true">
      <label>Area:</label>
      <choice value="*">ALL</choice>
      <populatingSearch earliest="0" latest="" fieldForLabel="Area" fieldForValue="Area">index=Your_Index  Dep=$Dep$ | stats count by Area</populatingSearch>
      <default>*</default>
    </input>

Regard,
Patient

0 Karma
Don’t Miss Global Splunk
User Groups Week!

Free LIVE events worldwide 2/8-2/12
Connect, learn, and collect rad prizes
and swag!