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!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...