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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

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