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!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...