Splunk Search

extract a matching string into field

shanyour
New Member

I have an event with a text spans over multiple lines. it has no key-value pattern. the body string has a uuid value. I want to extract only the uuid value into a field named uuid and dispaly them in | table time uuid row

ex.

2016/07/02 11:23:45 error nullpointerexception 123ACA12:2345:6785:DEF1:123890AB12345678 at line number 171

Tags (2)
0 Karma

somesoni2
Revered Legend

Give this a try

your base search | rex "(?<uuid>[0-9:A-z\r\n]+) at line number (?<row>\d+)" | table _time uuid row

https://regex101.com/r/HoJEl2/1

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...