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!

Community Content Calendar, November Edition

Welcome to the November edition of our Community Spotlight! Each month, we dive into the Splunk Community to ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...