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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...