All Apps and Add-ons

How to create Splunk Dashboard panel display depending on user input using tokens

sajalbansal2
Explorer

Hi All,
I want to display a panel depending on the value clicked by a user from a table of results. Let me explain the problem with below example:

Say I have a dashboard which lists top 3 products sold and their related figures.

Panel 1 = top 3 products sold. (let products names be A, B and C)

Panel 2 = this is an interactive panel which displays sales figures and more information about product A, only when a user clicks on the product A event from panel 1.

Panel 3 = this is an interactive panel which displays sales figures and more information about product B, only when a user clicks on the product B event from panel 1.

Panel 4 = this is an interactive panel which displays sales figures and more information about product C, only when a user clicks on the product C event from panel 1.

This means at a time my dashboard would display only 2 panels, panel 1 and panel 2 or 3 or 4 (depending on the product event clicked by the user).

My approach to solve this:
I am trying to use drilldown on panel 1 to capture the clicked value from it and storing it in a token.
Then I am using <condition> to match the value captured in that token to set and unset tokens related to panels 2, 3 and 4.
Then I'm using these tokens to show (depends) and hide (rejects) panels 2,3 and 4.

Doing this, I'm getting warnings such as "<set> is not allowed in condition-drilldown block" etc.
Can anyone please guide me on how to solve this problem?

Thanks,
Sajal

Labels (1)
Tags (3)
0 Karma

sajalbansal2
Explorer

Below is the code that I have recently edited. I suppose it will try to give an idea of what I want to achieve. Although, this is not working:

<drilldown>
<set token="catch_value">$click.value$</set>

<eval>
   if("$catch_value$"=='productA',<set token="showpanelofA">true</set>,<unset  token="showpanelofA">true</unset>)
</eval>

<eval>
    if("$catch_value$"=='productB',<set token="showpanelofB">true</set>,<unset token="showpanelofB">true</unset>)
</eval>

<eval>
if("$catch_value$"=='productC',<set token="showpanelofC">true</set>,<unset token="showpanelofC">true</unset>)
</eval>

</drilldown>

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud | Unified Identity - Now Available for Existing Splunk ...

Raise your hand if you’ve already forgotten your username or password when logging into an account. (We can’t ...

Index This | How many sides does a circle have?

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

Registration for Splunk University is Now Open!

Are you ready for an adventure in learning?   Brace yourselves because Splunk University is back, and it's ...