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!

Splunk is Nurturing Tomorrow’s Cybersecurity Leaders Today

Meet Carol Wright. She leads the Splunk Academic Alliance program at Splunk. The Splunk Academic Alliance ...

Part 2: A Guide to Maximizing Splunk IT Service Intelligence

Welcome to the second segment of our guide. In Part 1, we covered the essentials of getting started with ITSI ...

Part 1: A Guide to Maximizing Splunk IT Service Intelligence

As modern IT environments continue to grow in complexity and speed, the ability to efficiently manage and ...