Splunk Search

Regex Help!

kc_prane
Communicator

My Raw log says "message: (c4328dd3-d16e-4df8-a8e6-b2ebcab9d8bc)" 

I wanted to extract everything  inside the  Parentheses ( )

 

Thanks in advance.

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

yuanliu
SplunkTrust
SplunkTrust

Like this?

 

| rex "message: \((?<in_parentheseses>[^\)]+)"

 

You can test with

 

| makeresults format=csv data="_raw
message: (c4328dd3-d16e-4df8-a8e6-b2ebcab9d8bc)"
``` data emulation above ```
| rex "message: \((?<in_parentheses>[^\)]+)"

 

_rawin_parentheses
message: (c4328dd3-d16e-4df8-a8e6-b2ebcab9d8bc)c4328dd3-d16e-4df8-a8e6-b2ebcab9d8bc

View solution in original post

kc_prane
Communicator

Thank you for the help @yuanliu 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Like this?

 

| rex "message: \((?<in_parentheseses>[^\)]+)"

 

You can test with

 

| makeresults format=csv data="_raw
message: (c4328dd3-d16e-4df8-a8e6-b2ebcab9d8bc)"
``` data emulation above ```
| rex "message: \((?<in_parentheses>[^\)]+)"

 

_rawin_parentheses
message: (c4328dd3-d16e-4df8-a8e6-b2ebcab9d8bc)c4328dd3-d16e-4df8-a8e6-b2ebcab9d8bc
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...