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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...