Splunk Search

What is wrong with my eval for this token?

dbcase
Motivator

Hi,

I have this eval for a token but it doesn't ever seem to get set, what am I missing?

<eval token="showapppages">case($click.value$ == "Overview Page",0, $click.value$ == "Rules Page",1, $click.value$ == "History Page",2, $click.value$ == "Settings Page",3, $click.value$ == "Camera Page",4, $click.value$ == "Paring (Manage Devices) Page",5, $click.value$ == "Third-Party Card Page",6, $click.value$ == "Cloud Page",7, $click.value$ == "Custom Page",8, 1=1) </eval>
Tags (3)
0 Karma

vasanthmss
Motivator

when you try to compare the value add double quotes.

$click.value$ as "$click.value$"

so,

case("$click.value$" == "Overview Page",0, "$click.value$" == "Rules Page",1, "$click.value$" == "History Page",2, "$click.value$" == "Settings Page",3, "$click.value$" == "Camera Page",4, "$click.value$" == "Paring (Manage Devices) Page",5, "$click.value$" == "Third-Party Card Page",6, "$click.value$" == "Cloud Page",7, "$click.value$" == "Custom Page",8, 1=1) 

would help

V
0 Karma

dbcase
Motivator

Hi Vasanthmss,

Thanks! I was really hopeful it was that simple but alas.... no luck.

Maybe additional info would help. Here is the query and drilldown

<query>index=wholesale_app buildTarget=$mso_selection$ product=$Product_token$ Activity Properties.index=5  |convert num(Properties.args{}) as activityvalue|eval activitytype=case(activityvalue == "0", "Overview Page", activityvalue == "1", "Rules Page", activityvalue == "2", "History Page",activityvalue == "3", "Settings Page",activityvalue == "4", "Camera Page",activityvalue == "5", "Paring (Manage Devices) Page",activityvalue == "6", "Third-Party Card Page",activityvalue == "7", "Cloud Page",activityvalue == "8", "Custom Page")|stats count by activitytype|sort -count| appendpipe [stats count | where count=0]|rename activitytype as Page count as Count</query>
          <earliest>$time_field.earliest$</earliest>
          <latest>$time_field.latest$</latest>
          <sampleRatio>1</sampleRatio>






        </search>
           <drilldown>

          <set token="showapppagespanel">y</set>
          <eval token="showapppages">case("$click.value$" == "Overview Page",0, "$click.value$" == "Rules Page",1, "$click.value$" == "History Page",2, "$click.value$" == "Settings Page",3, "$click.value$" == "Camera Page",4, "$click.value$" == "Paring (Manage Devices) Page",5, "$click.value$" == "Third-Party Card Page",6, "$click.value$" == "Cloud Page",7, "$click.value$" == "Custom Page",8, 1=1) </eval>
          <unset token="showlogins"></unset>
        </drilldown>
0 Karma

vasanthmss
Motivator

what error you are getting? are you using table / chart?

does "click.value" populating?

refer: http://docs.splunk.com/Documentation/Splunk/7.2.0/Viz/DrilldownIntro
http://docs.splunk.com/Documentation/Splunk/7.2.0/Viz/PanelreferenceforSimplifiedXML#Predefined_dril...

add the token in the panel title to check its populating correctly.

" < panel > <title>$click.value$</title>"
V

dbcase
Motivator

Hi Vasanthmss!

The only "error" that I'm getting in the panel is "Search is waiting for input". Which typically tells me that the token never gets set. I'll try the panel trick. Thanks!

0 Karma

vasanthmss
Motivator

Any luck?

V
0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...