Getting Data In

In Dashboard: Remove Underscore in token

Splunkmm
Engager

Hi, I have a token as below in my dashboard,

                  <set token="mySource">replace($numSuffix$,"_","")</set>

and I have another token utilising the above,

                 <set token="source">$indexg$ connection $mySource"</set>

In Query I have,
                   <search>

                         <query>$source$ | timechart count by host </query>
                 </search>

Unfortunately this is not working, In splunk section query, its not evaluating.

Its reflecting as,

                           index=xer connection replace(_45t66,"_","") | timechart count by host

I tried with 
                         <set token="mySource">replace($numSuffix|s$,"_","")</set>
But its of no use.

Can someone help me with this? 

Thanks.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try using eval rather than set

<eval token="mySource">replace($numSuffix$,"_","")</eval>

View solution in original post

Splunkmm
Engager

Thank you so much for the response and yes it worked.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try using eval rather than set

<eval token="mySource">replace($numSuffix$,"_","")</eval>
Get Updates on the Splunk Community!

Index This | What’s a riddle wrapped in an enigma?

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

BORE at .conf25

Boss Of Regular Expression (BORE) was an interactive session run again this year at .conf25 by the brilliant ...

OpenTelemetry for Legacy Apps? Yes, You Can!

This article is a follow-up to my previous article posted on the OpenTelemetry Blog, "Your Critical Legacy App ...