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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...