Getting Data In

Regex help for a newby please

markturner14
Explorer

Hi All,  looking for some assistance on what a regex would look like when every new line starts with an open bracket e.g. (

I am a complete novice with regex so asking how this would be achieved.  I kinda understand the error - just not how to resolve.

my error is (from btool.log)

btool-support - Bad regex value: '([\r\n]+)\s*('', of param: props.conf / [<sourcetype] / LINE_BREAKER; why: missing closing parenthesis

 

Many thanks

Labels (1)
1 Solution

richgalloway
SplunkTrust
SplunkTrust

That's a special character in the regex world.  Treat it as a normal character by escaping it with '\'.

([\r\n]+)\s*\(
---
If this reply helps you, Karma would be appreciated.

View solution in original post

inventsekar
SplunkTrust
SplunkTrust

welcome @markturner14 to the wonderful world of regular expressions! 
hopefully the issue is resolved now i think. 

Please accept @richgalloway 's post or any post closer to your fix, choose it and accept it as the solution. 

 

Best Regards,

Sekar

PS - your karma points will be my 2 cents!

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
0 Karma

richgalloway
SplunkTrust
SplunkTrust

That's a special character in the regex world.  Treat it as a normal character by escaping it with '\'.

([\r\n]+)\s*\(
---
If this reply helps you, Karma would be appreciated.

markturner14
Explorer

Perfect,  thanks @richgalloway  and all for the fast supportive responses.

Works as expected 

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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