Splunk Search

Regex isnt working for my search string

navd
New Member

I want to extract a field from the log event using regex .following is the sample log event , can someone tell me how to write rex for it .My rex isn't working ,it says mismatched ']'

java.util.concurrent.Exception: Code: Internal Server Error; Exception: com.rate.ps.execute.exception.Exception: { "message": "not upto date" }
... 11 lines omitted ...

I want to write rex for "Code: Internal Server Error; Exception: com.rate.ps.execute.exception.Exception: { "message": "not upto date" }"

|rex (?([a-zA-Z]\w+.)+\w*Exception\W+[^"]+\W:\W+[^"]+\W*)

Tags (1)
0 Karma

jodyfsu
Path Finder

Not real sure which part you are trying to capture, but here is what I came up with:

| rex "java\.util\.concurrent\.Exception\:\s(?<CODE>.[^\;]+)\;\sException\:(?<EXCEPTION>.[^\:]+)\:\s\{\s(?<MSG>.[^\}]+)"

Let me know if you need more.

0 Karma
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 ...