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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...