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

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...