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," ,

 

Labels (1)
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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...