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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...