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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...