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!

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco &#43; Splunk! We’ve ...

AI Adoption Hub Launch | Curated Resources to Get Started with AI in Splunk

Hey Splunk Practitioners and AI Enthusiasts! It’s no secret (or surprise) that AI is at the forefront of ...