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!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...