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!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...