Splunk Dev

Inside drilldown tags - how to apply transformative operations on set tags - <set>

GaryZ
Path Finder

Can you apply transformative operations inside set tags from drilldown tags?

ex:

<drilldown>
<set token="form.builds_tk">$click.value$</set>
</drilldown>

 

Would like to take the value captured from click value, split it (or regex), then use the first value.

ex:

<drilldown>
<set token="form.builds_tk">mvindex(split("$click.value$", "-"), 1)</set>
</drilldown>

 

Labels (4)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Rather than using set use eval - try it like this

<drilldown>
 <eval token="form.builds_tk">mvindex(split("$click.value$", "-"), 1)</eval>
</drilldown>

View solution in original post

GaryZ
Path Finder

Awesome.... That worked. 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can do some great stuff with eval in drilldown, but be mindful that there are some bugs with using more than one multivalue eval statements, e.g. this one fails

<eval token="k1">mvindex($row.key$, mvfind($row.name$, $click.value2$))</eval>

as it fails trying to call mvindex with the result of the mvfind.

Note also that the first element is element 0, not 1 if that was your intention.

0 Karma

GaryZ
Path Finder

@bowesmana You are correct.  I did have to change my index to point at 0 instead of 1

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Rather than using set use eval - try it like this

<drilldown>
 <eval token="form.builds_tk">mvindex(split("$click.value$", "-"), 1)</eval>
</drilldown>
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...