Getting Data In

How to make input dependent on other inputs in a form?

oriches
Explorer

How can I make a combo box dependent on another combo box in a form?

The contents of the second combo box is dependent on the selection in the first.

Tags (3)
0 Karma
1 Solution

Damien_Dallimor
Ultra Champion

You'll have to use Advanced XML.

Lots of info in answers already such as this thread.

View solution in original post

0 Karma

iKate
Builder

You do not necessarily have to use Advanced XML for this at least in Splunk v6.0. Here's my example of how device_type selected with radio button is passed to the search populating dropdown. In two words: just add in the beginning of populating search your previous value like device_type=$device_type$

<fieldset autoRun="true" submitButton="false">
<input type="time" searchWhenChanged="true" token="cohort"> <default>Last 30 days</default> </input>
<input type="time" searchWhenChanged="true" token="search"> <default>Last 30 days</default> </input>
<!-- Specify search when changed for the inputs -->
<input type="radio" token="device_type" searchWhenChanged="true">
  <label>Select a device type:</label>
  <default>All</default>

  <!-- Define the choices in code -->
  <choice value="*">All</choice>
  <choice value="TV">TV</choice>
  <choice value="BDP">BDP</choice>
  <choice value="WEB">WEB</choice>
  <choice value="TBL">TBL</choice>
  <choice value="MOB">MOB</choice>
</input>

<input type="dropdown" token="device_manufacturer" searchWhenChanged="true">
  <label>Select a device manfacturer:</label>
  <prefix>device_manufacturer="</prefix>
  <suffix>"</suffix>
  <default>*</default>

  <!-- Define the default value -->      
  <choice value="*">All</choice>

  <!-- Define the choices with a populating search -->
  <populatingSearch fieldForValue="device_manufacturer" fieldForLabel="device_manufacturer" earliest="-48h" latest="now">
    <![CDATA[source=sc_context_creation device_type="$device_type$" | eval device_manufacturer=lower(device_manufacturer) 
    | stats count by device_manufacturer | sort 0 - count]]>
  </populatingSearch>
</input>

Damien_Dallimor
Ultra Champion

You'll have to use Advanced XML.

Lots of info in answers already such as this thread.

0 Karma
Get Updates on the Splunk Community!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...