Splunk Enterprise

How to add dependable/dynamic radio buttons?

Ashwini008
Builder

Hello,

I want to add dependable Radio button Functionality for below example.

When i click on 'TR DEPT' in Landscape View  then Filter radio buttons should be displayed with 'ALL' option being selected by default. When i select 'TR Failed' option then Filter radio buttons should not be displayed and it should be hidden.

Ashwini008_1-1635848562991.png

 

Could you please help me with code?

Thank you

Tags (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
    <input type="radio" token="lv">
      <label>Landscape View</label>
      <choice value="TRDEPT">TR DEPT</choice>
      <choice value="TRFAILED">TR FAILED</choice>
      <change>
        <condition value="TRDEPT">
          <set token="showfilter"></set>
          <set token="form.filter"></set>
        </condition>
        <condition value="TRFAILED">
          <unset token="showfilter"></unset>
        </condition>
      </change>
    </input>
    <input type="radio" token="filter" depends="$showfilter$">
      <label>Filter</label>
      <choice value="All">All</choice>
      <choice value="PRNO">PR NO</choice>
      <choice value="PRSTATUS">PR STATUS</choice>
      <default>All</default>
    </input>

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
    <input type="radio" token="lv">
      <label>Landscape View</label>
      <choice value="TRDEPT">TR DEPT</choice>
      <choice value="TRFAILED">TR FAILED</choice>
      <change>
        <condition value="TRDEPT">
          <set token="showfilter"></set>
          <set token="form.filter"></set>
        </condition>
        <condition value="TRFAILED">
          <unset token="showfilter"></unset>
        </condition>
      </change>
    </input>
    <input type="radio" token="filter" depends="$showfilter$">
      <label>Filter</label>
      <choice value="All">All</choice>
      <choice value="PRNO">PR NO</choice>
      <choice value="PRSTATUS">PR STATUS</choice>
      <default>All</default>
    </input>

Ashwini008
Builder

@ITWhisperer Thanks for the response.

When clicked on TR DEPT radio button ,'ALL' choice value is not default selected. Even if it is set to default value and initial value is true

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Can you share you dashboard XML?

0 Karma

Ashwini008
Builder

@ITWhisperer I have used the same code which you have shared . I just added your code in new dashboard. Default is not selected for 'ALL'

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Which release of splunk are you using?

0 Karma

Ashwini008
Builder

Splunk Version 7.0.0

0 Karma

Ashwini008
Builder

This is working fine in 8.0.1 version of splunk. Thank You

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, ...