Splunk Enterprise

Why does my rex not work on splunk?

SplunkEmp22
Engager

Hi, i don't know where is the problem. The search it's:

| rex '(?<field>H.+)\\'

| table field

I want to use regular express. for parsing field and i want to show in output the result.  The field got a path like \Pc\Hardware\Nice\ok . I want to get all of the words after Pc\. 

I don't know how to solve, he literaly does nothing and return the same origin data.

Thank u

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You have to double-up on backslashes in Splunk regex - compared to something that works in regex101.com for example

| rex "(?<field>H.+)\\\\"

View solution in original post

SplunkEmp22
Engager

Top bro. I'm learning from regex101, so i didn't know that. Thank u man

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You have to double-up on backslashes in Splunk regex - compared to something that works in regex101.com for example

| rex "(?<field>H.+)\\\\"
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...