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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...