Splunk Search

Regex Error - Regex: PCRE does not support \L, \l, \N{name}, \U, or \u

snoobzilla
Builder

A little help needed. Regex below is throwing the error in title of question...

rex field=source "N:\\logs\\(?P<UID>[^_]+)"

The source I am trying to match against has following format...

N:\logs\username_blah.log

Thanks!

Tags (3)
0 Karma
1 Solution

somesoni2
Revered Legend

You need one more backward slash for escape. This works fine with sample value.

|rex field=source "N:\\\logs\\\(?P<UID>[^_]+)"

View solution in original post

0 Karma

somesoni2
Revered Legend

You need one more backward slash for escape. This works fine with sample value.

|rex field=source "N:\\\logs\\\(?P<UID>[^_]+)"
0 Karma

snoobzilla
Builder

Doesn't seem to work with either 2 or 4 backslashes as transform.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

transforms.conf should require only two backslashes.

The rex command takes a string - that string uses backslashes as its escape character, requiring extra backslashes. transforms.conf doesn't take a string in a programming sense, so there's one fewer layer of escaping going on.

0 Karma

somesoni2
Revered Legend

Try with 4 backslashes.

0 Karma

snoobzilla
Builder

That worked inline, thanks!

Any idea how to get this to work in a transform? I get same error when I save transform three slashes and it doesn't work with two.

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...