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!

What’s New in Splunk Cloud Platform 9.1.2308?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2308! Analysts can ...

Index This | Why do they call it hyper text?

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

State of Splunk Careers 2023: Career Resilience and the Continued Value of Splunk

For the past three years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...