All Apps and Add-ons

Escaping $ in SideView Search Module

Dan
Splunk Employee
Splunk Employee

Using SVU 2.1.2, I have a Search module with the following:

<![CDATA[
search ... | eval isError=if(match(MethodString,"e$"),"True","False")
]]>

This complains "Unbalanced quotes."

How do I escape the $ so SideView doesn't try expanding it into a token?

0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

If you need to put in a literal "$" character, you just put two consecutive chars together like so: "$$".

Here are some documentation pages about $foo$ tokens.

  1. Overview of all $foo$ tokens, and which ones are available downstream from which modules :
    "Key Techniques > Other > Overview of all the $foo$ tokens"

  2. Some docs specifically about encoding literal dollar signs as "$$", on the HTML module's page:
    "Module Documentation > Html Module > Embedding HTML and including $foo$ values".

    Although it's within the HTML module section, the same $$ trick will work everywhere.

View solution in original post

sideview
SplunkTrust
SplunkTrust

If you need to put in a literal "$" character, you just put two consecutive chars together like so: "$$".

Here are some documentation pages about $foo$ tokens.

  1. Overview of all $foo$ tokens, and which ones are available downstream from which modules :
    "Key Techniques > Other > Overview of all the $foo$ tokens"

  2. Some docs specifically about encoding literal dollar signs as "$$", on the HTML module's page:
    "Module Documentation > Html Module > Embedding HTML and including $foo$ values".

    Although it's within the HTML module section, the same $$ trick will work everywhere.

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 ...