Splunk Search

Extract data between curly brackets

Digvijay
Path Finder

I want to extract data between 2 curly brackets {} from below ErrorText string

Digvijay_0-1626174213250.png

 

Labels (1)
0 Karma
1 Solution

venkatasri
SplunkTrust
SplunkTrust

Hi @Digvijay 

Can you try this regex? I assumed your input field as error_text and output will be populated in error_inside.

 

<your_search_goes_here>
| rex field=error_text "\{(?<error_inside>[^\}]+)"

 

--

An upvote would be appreciated and Accept solution if this reply helps!

View solution in original post

Tags (2)

venkatasri
SplunkTrust
SplunkTrust

Hi @Digvijay 

Can you try this regex? I assumed your input field as error_text and output will be populated in error_inside.

 

<your_search_goes_here>
| rex field=error_text "\{(?<error_inside>[^\}]+)"

 

--

An upvote would be appreciated and Accept solution if this reply helps!

Tags (2)

Digvijay
Path Finder

@venkatasri  thank you so much .Perfect solution😊

 

0 Karma
Get Updates on the Splunk Community!

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...

Join Us at the Builder Bar at .conf24 – Empowering Innovation and Collaboration

What is the Builder Bar? The Builder Bar is more than just a place; it's a hub of creativity, collaboration, ...

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...