Splunk Search

Simple XML - Token inside eval if

dojiepreji
Path Finder

Hello,

I have an eval if condition in my dashboard for my drilldown:

<eval token="query">if('category'=="Total",  "search ageGroup=*", where ageGroup='group_token')</eval>

I pass this line of search to a query on another dashboard. If the user clicks on 'Total' on the table, it will search everything for all age groups. If the user clicks on a particular age group, it will need to search the ageGroup in $group_token$.

This isn't working fine. How do I pass group_token to the search string to the other dashboard?

0 Karma

woodcock
Esteemed Legend

Don't do it this way. Assuming that your table events have a field called ageGroup, create a field called _group_token by adding this to the end of your existing search: | eval _group_token = coalesce(ageGroup, "*") (assuming that your Total field does not have a value for ageGroup). Then use standard drilldown with ... ageGroup = $click._group_token. Check out the Dashboard Examples app for drilldown details.

0 Karma

wmyersas
Builder

If I understand you correctly, you're trying to pass the value of a token on dashboardA as a GET argument in the URL string of dashboardB, correct?

If so, edit the drilldown targets like this:

drilldown editor screenshot

Of course, this presumes dashboardB can do something with URL parameters 🙂

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...