Splunk Search

How to extract field using regex?

evallja
Path Finder

Hello everyone,

Please, I need to extract a field named product (with its value in bold) from the below Message field values, and a field named status (with its value in italics):

Message="Product: Microsoft SQL Server 2019 LocalDB -- Installation completed successfully."
Message="Product: Microsoft OLE DB Driver for SQL Server -- Installation completed successfully."

Thank you in advance.

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @evallja,

please try this:

| rex field=Message "^Product:\s+(?<Product>[^-]+)"

that you can test at https://regex101.com/r/922J2Q/1

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @evallja,

please try this:

| rex field=Message "^Product:\s+(?<Product>[^-]+)"

that you can test at https://regex101.com/r/922J2Q/1

Ciao.

Giuseppe

Get Updates on the Splunk Community!

Why You Can't Miss .conf25: Unleashing the Power of Agentic AI with Splunk & Cisco

The Defining Technology Movement of Our Lifetime The advent of agentic AI is arguably the defining technology ...

Deep Dive into Federated Analytics: Unlocking the Full Power of Your Security Data

In today’s complex digital landscape, security teams face increasing pressure to protect sprawling data across ...

Your summer travels continue with new course releases

Summer in the Northern hemisphere is in full swing, and is often a time to travel and explore. If your summer ...