Splunk Search

Extract substring with mutiple [ in a string

rreddy
Observer

I have a String is in the pattern:

[substring1][substring2][substring3] Spark App State changed to FAILED. Total time taken is 10 minutes

I want to extract it into 4 fileds:

Field1 = substring1

Field2 = substring2

Field3 = substring3

Field4 = 10 

Please help.

Labels (3)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex "\[(?<field1>[^\[]+)\]\[(?<field2>[^\[]+)\]\[(?<field3>[^\[]+)\].*Total time taken is (?<field4>\d+)"
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to July Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

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

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...