Dashboards & Visualizations

How to set $click.name$ token if it has been changed?

ollie920049
Path Finder

Hi,

I have a bar graph where drilldown tokens are set:

<drilldown>
     <set token="wl_user">$click.value$</set>
     <set token="wl_zone">$click.name2$</set>
</drilldown>

This works without issue when a user clicks on the 'bar' elements. However, if a user clicks on the legend, the $click.name2$ value is successfully set, but the $wl_user$ token is not, as $click.value$ is (rightly) null.

The problem is that when I initialize this page, I programmatically set these tokens to * to enable some drilldown searching.

I guess my question is - can I conditionally set the $wl_user$ token if $click.name$ has a value?

Thanks,
Ollie

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Which Splunk version you're in? If you're in 6.3+, then you've 'eval' tag available as child for drilldown tag using which you can conditionally set your tokens see this.

http://docs.splunk.com/Documentation/Splunk/6.3.0/Viz/PanelreferenceforSimplifiedXML#eval

View solution in original post

somesoni2
Revered Legend

Which Splunk version you're in? If you're in 6.3+, then you've 'eval' tag available as child for drilldown tag using which you can conditionally set your tokens see this.

http://docs.splunk.com/Documentation/Splunk/6.3.0/Viz/PanelreferenceforSimplifiedXML#eval

ollie920049
Path Finder

As @somesoni2 mentioned this was achievable with eval tag in XML (as of Splunk 6.3).

Code looked something like the following:

<drilldown>
    <eval token='wl_user'>if(isnull('click.value'), "*", 'click.value')</eval>
</drilldown>

Make sure you note the difference between an evaluated variable contained within a single quote, and a string literal contained within a double quote ('*' will not work, has to be "*").

0 Karma

ollie920049
Path Finder

Yep - Using 6.3. Did spot the 'eval' tag, but haven't been able to form a conditional within the XML that would evaluate to '$click.value$' does not exist?

0 Karma
Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...