Splunk Search

How to remove ** using regex in field extraction

reach2tushar
Explorer

Hi,

I have to do field extraction on the following data.

****2014/02/02 10:10:10 level - test

Can please help to get the regex to extract fields:
Date = 2014/02/02
Time = 10:10:10
Level = level
Message = Text

Your help is greatly appreciated.

Tags (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

This works with your example event on RegExr:

(?<Date>\d{4}\/\d{2}\/\d{2})\s(?<Time>\d{2}:\d{2}:\d{2})\s(?<Level>\S*)\s-\s(?<Message>[\s\S]*)
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

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 ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...