Hello
I have a dashboard with a drop-down containing 3 choices. If choice 3 is selected, I want to show a panel. If choices 1 or 2 are selected, that panel should be hidden. I do see a few posts related to this, but they are not doing the trick for me. I see I have to use ,
. Dashboard is Simple XML. Splunk version is 6.4.1.2.
The weird thing is, it worked yesterday and I tested it multiple times. I don't remember changing anything, but it is not working today. I tried the "depends" on the and tags but it's not working.
xxx
xxx
<input type="dropdown" token="type">
<label>type</label>
<choice value="a">A</choice>
<choice value="b">B</choice>
<choice value="c">C</choice>
<default>a</default>
<change>
<condition value="a">
<unset token="a-details"></unset>
<unset token="b-details"></unset>
<set token="c-details"></set>
</condition>
<condition value="b">
<unset token="a-details"></unset>
<unset token="c-details"></unset>
<set token="b-details"></set>
</condition>
<condition value="c">
<unset token="a-details"></unset>
<unset token="b-details"></unset>
<set token="c-details"></set>
</condition>
</change>
</input>
<panel depends="$c-details$">
<chart>
<title></title>
<search>
<query>xxxx</query>
<earliest>$time_tok.earliest$</earliest>
<latest>$time_tok.latest$</latest>
</search>
</chart>
</panel>
You you <set>
options, add a value. For example <set token="c-details">true</set>
. You don't need to do that for <unset>
@pdpsplunk100 @sundareshr @ppablo Is there any update for achieving the same in splunk 9.0.5.1 version?
You you <set>
options, add a value. For example <set token="c-details">true</set>
. You don't need to do that for <unset>
Yes that did the trick. Thanks a lot!
Please accept the answer to close it out.
Thanks for your comments. Ok here is the code I have right now.
<input type="dropdown" token="type">
<label>type</label>
<choice value="a">A</choice>
<choice value="b">B</choice>
<choice value="c">C</choice>
<default>a</default>
<change>
<condition value="a">
<unset token="b-details"></unset>
<unset token="c-details"></unset>
<set token="a-details"></set>
</condition>
<condition value="b">
<unset token="a-details"></unset>
<unset token="c-details"></unset>
<set token="b-details"></set>
</condition>
<condition value="c">
<unset token="a-details"></unset>
<unset token="b-details"></unset>
<set token="c-details"></set>
</condition>
</change>
<title></title>
<search>
<query>xxxx</query>
<earliest>$time_tok.earliest$</earliest>
<latest>$time_tok.latest$</latest>
</search>
<panel depends="$c-details$">
<chart>
<title></title>
<search>
<query>xxxx</query>
<earliest>$time_tok.earliest$</earliest>
<latest>$time_tok.latest$</latest>
</search>
</chart>
</panel>
Sorry for the multiple comments. The tag did not appear and so had to comment again.
Hi @pdpsplunk100
I think some parts of your explanation didn't render properly, particularly the last sentence. Make sure you highlight any sample code (especially anything with angle brackets like XML) and click the Code Sample button in the text editing tools, or surround the code with backticks so it ends up looking like <this>
.