Dashboards & Visualizations

Regular expression in "|rex field" to return string between two single quotes (") after "text="?

mlevsh
Builder

Hi,

We need to extract text after "description=" between two single quotes (") into a  new field "my_description":

,description="Env: Application: Upgrade App  from 1.0.0 to 2.0.0 on server myserver.mydomain.com. This is being done to support the upcoming upgrade to Patch 3 release.

All changes and post implementation verification will be done.
This has been tested successfully .",

we used the following search extraction that works for majority of events but on rare occasions it is not extracting.
Any suggestions?

| rex field=_raw ",my_description=\W(?<description>.*?)\W," ,

 

Tags (3)
0 Karma

isoutamo
SplunkTrust
SplunkTrust
Hi,
Those variables are in wrong order:

| rex field=_raw ",description=(?<my_description>[^\"]+)"

You could check these with https://regex101.com
0 Karma
Get Updates on the Splunk Community!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...