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!

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...

Explore the Latest Educational Offerings from Splunk [January 2025 Updates]

At Splunk Education, we are committed to providing a robust learning experience for all users, regardless of ...

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...