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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...