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>

Labels (1)
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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...