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!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...