Splunk Search

Passing token to dashboard query

nagarjuna119
Engager

Passing a token to dashboard using below is not working, dashboard is stuck on "search is waiting for input"

message below is a json field so using spath to parse its fields, I have used the token in the title and it showed the right value, and below query works fine without token 

index="indextest" source="my source" sourcetype="ab-xyz" | spath input=message | UserName = $UserName_Token$
| table JobServiceId CreateDateTime Status UserName 

 

 

0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

There's an error in your SPL. This is not valid SPL, but maybe that's a typo

 

...
| UserName = $UserName_Token$
...

 

Did you mean?

| where UserName = "$UserName_Token$"

Note quotes

View solution in original post

0 Karma

bowesmana
SplunkTrust
SplunkTrust

There's an error in your SPL. This is not valid SPL, but maybe that's a typo

 

...
| UserName = $UserName_Token$
...

 

Did you mean?

| where UserName = "$UserName_Token$"

Note quotes

0 Karma

nagarjuna119
Engager

That worked if I select a specific value thank you.
However when I use  * as default value to return all the entires it does't return any results 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

This is where the use of '| where' or '| search' is relevant.

If using where, then it's a regex, so just having * will not work, it needs to be .* but if you use search you can just use * as the wildcard, but it's less precise as using where.

 

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!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...