Splunk Search

How to use $ symbol in a view

ChhayaV
Communicator

Hi,

How to escape/ or use $ symbol from (?PERROR\s-\s[^\n\r]+?(?=\s[0-9]|$|[\n\r])) regex which is in below
view

View :

 <module name="URLLoader" layoutPanel="panel_row1_col1" group="Details" autoRun="True">
    <module name="Search">
        <param name="search">index="mwrap_idx"  sourcetype="CARApp" $excep$ | rex field=_raw "(?P<test>ERROR\s-\s[^\n\r]+?(?=\s[0-9]|$|[\n\r]))" | rename test as Exception | lookup Lookupcarexcep.csv  "Logged Text" AS Exception OUTPUT "Display Text" | table "Display Text" Exception _raw</param>
        <module name="SimpleResultsTable">
            <param name="entityName">results</param>
            <param name="drilldown">row</param> 

            <module name="ConvertToDrilldownSearch">
              <module name="ViewRedirector">
              <param name="viewTarget">flashtimeline</param>
              <param name="popup">True</param>
              </module>
          </module>

It is giving me "Unbalanced quotes" error

Tags (3)
0 Karma

ChhayaV
Communicator

yeah i tried putting "\"(slash). it didn't work.
But "$$" (two dollars back to back)works 🙂

0 Karma

somesoni2
Revered Legend

try putting "\" before the $.

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

You could try using CDATA. CDATA allows "raw" text in xml.

<param name="search"><![CDATA[index="mwrap_idx" sourcetype="CARApp" $excep$ | rex field=_raw "(?P<test>ERROR\s-\s[^\n\r]+?(?=\s[0-9]|$|[\n\r]))" | rename test as Exception | lookup Lookupcarexcep.csv "Logged Text" AS Exception OUTPUT "Display Text" | table "Display Text" Exception _raw]]></param>

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

Did this work for you? if so, please mark as accepted. Thanks!

ChhayaV
Communicator

I'll try the CDATA. i didn't know this. Thank you alacercogitatus

0 Karma
Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

 Ready to master Kubernetes and cloud monitoring like the pros? Join Splunk’s Growth Engineering team for an ...

Update Your SOAR Apps for Python 3.13: What Community Developers Need to Know

To Community SOAR App Developers - we're reaching out with an important update regarding Python 3.9's ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...