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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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