Splunk Enterprise

How to display the corresponding panels based on selected check boxes with 3 choices?

Ashwini008
Builder

Hi,

I have checkboxes with 3 choices like below 

Ashwini008_0-1634540040405.png

i want to display the panel based on the checkbox selected .

Ex: If A & B are selected then corresponding panel should be displayed. Similarly for any other choices like B&C or A&C the corresponding panel should be displayed.

Ashwini008_1-1634540254090.png

Can you please help me the code.

P.S: Currently i am able to display the panel if only one checkbox is selected or if all the three checkboxes are selected with condition based xml code. 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Can you share you current XML code?

0 Karma

Ashwini008
Builder

@ITWhisperer 
<input type="checkbox" id="checked_box" token="checkbox">
<label></label>
<choice value="A">A</choice>
<choice value="B">B</choice>
<choice value="C">C</choice>
<change>
<condition match="isnull($checkbox$)">
<set token="noneselected">Select Atleast One Checkbox</set>
<unset token="A"></unset>
<unset token="ALL"></unset>
<unset token="B"></unset>
<unset token="C"></unset>
</condition>
<condition label="B">
<set token="B">B</set>
<set token="noneselected"></set>
<unset token="A"></unset>
<unset token="ALL"></unset>
<unset token="C"></unset>
</condition>
<condition label="A">
<set token="A"></set>
<set token="noneselected"></set>
<unset token="B"></unset>
<unset token="ALL"></unset>
<unset token="C"></unset>
</condition>
<condition label="C">
<set token="C"></set>
<set token="noneselected"></set>
<unset token="B"></unset>
<unset token="ALL"></unset>
<unset token="A"></unset>
</condition>
<condition value="*">
<unset token="A"></unset>
<unset token="B"></unset>
<unset token="C"></unset>
<set token="ALL"></set>
<set token="noneselected"></set>
</condition>
</change>
<default>A,B,C</default>
<initialValue>A,B,C</initialValue>
<delimiter> </delimiter>
</input>

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try it this way

    <input type="checkbox" token="checkbox">
      <label></label>
      <choice value="A">A</choice>
      <choice value="B">B</choice>
      <choice value="C">C</choice>
      <change>
        <eval token="A">if(match($checkbox$,"A"),"A",null())</eval>
        <eval token="B">if(match($checkbox$,"B"),"B",null())</eval>
        <eval token="C">if(match($checkbox$,"C"),"C",null())</eval>
      </change>
      <default>A,B,C</default>
      <initialValue>A,B,C</initialValue>
      <delimiter> </delimiter>
    </input>
    <html>
      <p>checkbox ($checkbox$) - A ($A$) - B ($B$) - C ($C$)</p>
    </html>
    <html depends="$A$">
      <p>A ($A$)</p>
    </html>
    <html depends="$B$">
      <p>B ($B$)</p>
    </html>
    <html depends="$C$">
      <p>C ($C$)</p>
    </html>
0 Karma
Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

New Release | Splunk Cloud Platform 10.1.2507

Hello Splunk Community!We are thrilled to announce the General Availability of Splunk Cloud Platform 10.1.2507 ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

&#x1f5e3; You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...