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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...