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!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...