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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...