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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...