Splunk Search

How to write the regular expression to extract this field from my sample log structure?

lukeandrews
New Member

Hey everyone,

I'm trying to add an interesting field to the extraction of one source type.

The log structure is as follows:

Action: Archived DLN
Type: fob
Status: Received DLN

I'm trying to capture the Action field, but I'm getting the error:

The extraction failed. If you are extracting multiple fields, try removing one or more fields. Start with extractions that are embedded within longer text strings.

I'm relatively new to Splunk and Regular expressions, so would really appreciate any assistance.

0 Karma

sundareshr
Legend

You will be better off using custom regex. So when in IFX, instead of letting Splunk determine the regex, use this as your regex and set appropriate permissions. This should create a field called action

Action:\s+(?<action>[^\t\n]+)
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...