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!

How to Monitor Google Kubernetes Engine (GKE)

We’ve looked at how to integrate Kubernetes environments with Splunk Observability Cloud, but what about ...

Index This | How can you make 45 using only 4?

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

Splunk Education Goes to Washington | Splunk GovSummit 2024

If you’re in the Washington, D.C. area, this is your opportunity to take your career and Splunk skills to the ...