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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...