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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...