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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...