Dashboards & Visualizations

Drilldown using two different token values obtained from two inputs

newsplunker2024
Explorer

Hi,

I'm trying to drilldown on a table using two different input values (from two radio button inputs). When I have input from one radio button, it works all fine.

For eg, if I have this statement in drilldown tag of table it works perfectly:

<set token="tokenNode">$click.value$</set>

 

However, when I place second set token statements It just says No Results Found:

I tried both click.value & click.value2

Option 1:

<set token="tokenNode">$click.value$</set>

<set token="tokenSwitch">$click.value$</set>

 

Option 2:

 

<set token="tokenNode">$click.value$</set>

<set token="tokenSwitch">$click.value2$</set>

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

It sounds like it is working, just not with the results you expect? Search has an implied AND so perhaps you need an explicit OR?

| search node="$form.tokenNode$" OR outcome="$form.tokenSwitch$"

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Please provide more detail - what is the source of your dashboard? how are you using the tokens? if the tokens both have the same value, can you not just use one token?

0 Karma

newsplunker2024
Explorer

I have a table which is getting data from one of our indexes, somewhat like below:

<table>
<title>Tech Spec Values for Selected Node:</title>
<search>
<query>index=test_index_prod sourcetype="SPEC"
| eventstats max(rundate) as maxDate, max(runtime) as maxTime, count as fno
| where rundate=maxDate AND runtime=maxTime
| search node="$form.tokenNode$" outcome="$form.tokenSwitch"
| table node, outcome, name, class, resource
| sort node, name</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="drilldown">cell</option>
<drilldown>
<set token="tokenNode">$click.value$</set>
<set token="tokenSwitch">$click.value$</set>
</drilldown>
</table>

 

And then I have two radio button fields with token names as tokenNode & tokenSwitch with both having different values. I want the drilldown to happen when any of the radio button value is selected by user from the two radio button input fields.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

This seems a bit confused - drilldown happens when the user clicks on a cell in the table. In your instance, this appears to set two tokens to the same value (based on where the user clicked). Your search also includes using the value of two input tokens. When either of these inputs is changed, the search will run again, using the new values of the tokens. This isn't drilldown. This is just how inputs and tokens work.

Please can you try to give more concrete examples of what your events look like, what the rest of your dashboard looks like, what you would like to happen when the user interacts with your dashboard, etc.?

0 Karma

newsplunker2024
Explorer

I'm sorry if I'm causing confusion. And not sure if you would call this drilldown.

My requirement:

I have two input fields(type - radio buttons). And depending on what value the user selects I want the filters to apply on two of the fields in the table namely node & outcome. For which I've written these statements in the table query:

| search node="$form.tokenNode$" outcome="$form.tokenSwitch$"

Node(radio button has below options):

ABC

DEF

XYZ

Outcome(radio button has below options):

True

False

Both

If I use one radio button(lets say just node) field it works, however when I add the second one it doesn't work. Means when im selecting node values from the radio button, the table is reloading & filtering the data based on the node value selected. I want the same to work for the second radio button as well.

here is how these input (radio buttons look like):

<input type="radio" token="tokenNode" searchWhenChanged="true">
<label>Node</label>
<choice value="ABC">ABC</choice>
<choice value="DEF">DEF</choice>
<choice value="XYZ">XYZ</choice>
<default>ABC</default>
<initialValue>ABC</initialValue>
</input>
<input type="radio" token="tokenSwitch" searchWhenChanged="true">
<label>Outcome</label>
<choice value="True">True</choice>
<choice value="False">False</choice>

<choice value="Both">Both</choice>
<default>True</default>
<initialValue>True</initialValue>
</input>

Hope I'm able to explain it.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It sounds like it is working, just not with the results you expect? Search has an implied AND so perhaps you need an explicit OR?

| search node="$form.tokenNode$" OR outcome="$form.tokenSwitch$"
Get Updates on the Splunk Community!

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...

AppDynamics is now part of Splunk Ideas

Hello Splunkers, We have exciting news for you! AppDynamics has been added to the Splunk Ideas Portal. Which ...

Advanced Splunk Data Management Strategies

Join us on Wednesday, May 14, 2025, at 11 AM PDT / 2 PM EDT for an exclusive Tech Talk that delves into ...