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!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...