Installation

Regex

Khuzair81
Path Finder

Hi All,

Please help me to solve this.

desc="Trigger App : Search [Abc_[qwert] asd] number" 

I want to fetch the "[Abc_[qwert] asd]" from the above string

Thanks

Labels (1)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @Khuzair81,

Please try below;

| rex field=desc "(?<new_field>\[.+[^\]].*\])"
If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

Bigslee
New Member

try using https://regex101.com . You can test your regex statements prior to using them on splunk

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @Khuzair81,

Please try below;

| rex field=desc "(?<new_field>\[.+[^\]].*\])"
If this reply helps you an upvote and "Accept as Solution" is appreciated.

Khuzair81
Path Finder

@scelikokThankyou 

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...