Splunk Search

REGEX

dteixeira98
Engager

Hi guys, im noob in regular expressions!!

2021-07-05 23:22:12.807 +01:00 [WRN] XXXXX.Membership.Renew Long Running Request: IntegratePaymentCommand (1082 milliseconds) Jobs {"BatchSize":10,"MaxRetry":5,"$type":"IntegratePaymentCommand"}


What if I want to take [WRN] as event_level.. can be  [WRN] or [ERR].
And ( xxxxx miliseconds) as time.

Labels (3)
0 Karma
1 Solution

venkatasri
SplunkTrust
SplunkTrust

Hi @dteixeira98 Can you try this?

<your_search_goes_here>
| rex "\[(?<level>\w+)\].+\((?<time_taken>\d+)\s+milliseconds"

 Field level will have WRN, ERR, ERROR etc and time_taken would be milliseconds.

venkatasri_1-1625828579651.png

 

--

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

View solution in original post

Tags (1)

dteixeira98
Engager

Thanks that really helped me!

0 Karma

venkatasri
SplunkTrust
SplunkTrust

@dteixeira98  Great! Appreciate if you could Accept the solution that helps others.

venkatasri
SplunkTrust
SplunkTrust

Hi @dteixeira98 Can you try this?

<your_search_goes_here>
| rex "\[(?<level>\w+)\].+\((?<time_taken>\d+)\s+milliseconds"

 Field level will have WRN, ERR, ERROR etc and time_taken would be milliseconds.

venkatasri_1-1625828579651.png

 

--

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

Tags (1)
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...