Splunk Search

How to update the table token results depending on the dynamic token selected on radio and passit to multiple link list?

kelz
Explorer

Hi Splunkers,

Is it possible to make a dynamic token results based on the radio and multiple link with same token value.

I want to achieve a result like this.

If I click value "1" on the radio button, link 1 input will show up and the default value for this link input will pass on the table input it should be "A". If I change the value "1" to value "2", link 2 input will show up and default value for it will update the table it should be "D"

Below is my sample query. Appreciate your help on this. Thanks inadvance!

<form>
<label>Multi Link Input</label>
<fieldset submitButton="false">
<input type="radio" token="select_link" searchWhenChanged="true">
<label>Select Link List</label>
<choice value="1">1</choice>
<choice value="2">2</choice>
<change>
<condition value="2">
<set token="show_2">true</set>
<unset token="show_1"></unset>
</condition>
<condition value="1">
<set token="show_1">true</set>
<unset token="show_2"></unset>
</condition>
</change>
<default>1</default>
</input>
<input type="link" token="select" searchWhenChanged="true" depends="$show_1$">
<label>1</label>
<choice value="A">A</choice>
<choice value="B">B</choice>
<choice value="C">C</choice>
<default>A</default>
</input>
<input type="link" token="select" searchWhenChanged="true" depends="$show_2$">
<label>2</label>
<choice value="D">D</choice>
<choice value="E">E</choice>
<choice value="F">F</choice>
<default>D</default>
</input>
</fieldset>
<row>
<panel>
<event>
<search>
<query>| makeresults
| eval $select$ = "$select$"</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="list.drilldown">none</option>
<option name="refresh.display">progressbar</option>
</event>
</panel>
</row>
</form>

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Something like this?

<form>
  <label>Multi Link Input</label>
  <fieldset submitButton="false">
    <input type="radio" token="select_link" searchWhenChanged="true">
      <label>Select Link List</label>
      <choice value="1">1</choice>
      <choice value="2">2</choice>
      <change>
        <condition value="2">
          <set token="show_2">true</set>
          <unset token="show_1"></unset>
        </condition>
        <condition value="1">
          <set token="show_1">true</set>
          <unset token="show_2"></unset>
        </condition>
      </change>
      <default>1</default>
    </input>
    <input type="link" token="select" searchWhenChanged="true" depends="$show_1$">
      <label>1</label>
      <choice value="A">A</choice>
      <choice value="B">B</choice>
      <choice value="C">C</choice>
      <default>A</default>
      <change>
        <set token="select">$value$</set>
      </change>
    </input>
    <input type="link" token="select" searchWhenChanged="true" depends="$show_2$">
      <label>2</label>
      <choice value="D">D</choice>
      <choice value="E">E</choice>
      <choice value="F">F</choice>
      <default>D</default>
      <change>
        <set token="select">$value$</set>
      </change>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults
| eval $select$ = "$select$"</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </table>
    </panel>
  </row>
</form>
0 Karma
Get Updates on the Splunk Community!

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureThursday, March 27, 2025  |  11AM PST / 2PM EST | Register NowStep boldly ...

Splunk AppDynamics with Cisco Secure Application

Web applications unfortunately present a target rich environment for security vulnerabilities and attacks. ...