Splunk Search

Help with Regex to extract values inside of the []

napoleon182
Explorer

Good afternoon Splunk ninjas, i will require your assistance in designing regex that will help me take the values inside of the [] brackets, my sample log line:

 

2022-09-23T13:20:25.765+01:00 [29] WARN  Core.ErrorResponse - {} - Error message being sent to user with Http Status code: BadRequest:
{"Details":[{"Code":50,"FieldName":"myfield","Message":"Please supply the value of my field","Detail":null}],"Message":"Sorry, we're unable to process your request. Please check your details and try again.","UserMessage":null,"Code":1,"Explanation":null,"Resolution":null,"Category":2}

 

I'm interested in filtering for the values of Details: code, FieldName, Message and Detail, many thanks for your help!

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| rex "\[(?<details>\{.*\})\]"
| spath input=details

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| rex "\[(?<details>\{.*\})\]"
| spath input=details

napoleon182
Explorer

Thank you so much, this has worked, marking it as resolution

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...