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!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...