Splunk Search

What is the regular expression to extract "java.net.SocketTimeoutException: Read timed out" from my raw event?

sravankaripe
Communicator

please help me with rex
i want to retrieve java.net.SocketTimeoutException: Read timed out from below _raw

"msgContentType":"java.net.SocketTimeoutException: Read timed out"
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi sravankaripe
try

\"msgContentType\"\:\"(?<your_field>[^\"]*)

see at https://regex101.com/r/eNg0P0/1
Bye.
Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi sravankaripe
try

\"msgContentType\"\:\"(?<your_field>[^\"]*)

see at https://regex101.com/r/eNg0P0/1
Bye.
Giuseppe

0 Karma

sravankaripe
Communicator

in the same event i have one more
"msgContentType":"Exception occured Retirement Audit Rest service"

it is retriving "Exception occured Retirement Audit Rest service"

whai need is "java.net.SocketTimeoutException: Read timed out"

0 Karma

sravankaripe
Communicator

what* need is "java.net.SocketTimeoutException: Read timed out"

0 Karma

gcusello
SplunkTrust
SplunkTrust

try this
\"msgContentType\":\"(?java[^\"]*)
see https://regex101.com/r/eNg0P0/2
Bye.
Giuseppe

0 Karma

sravankaripe
Communicator

sry not working

0 Karma

gcusello
SplunkTrust
SplunkTrust

Can you share some example of your logs, to detail the regex?
because as you can see in regex101 it seems to work..
Bye.
Giuseppe

0 Karma

sravankaripe
Communicator

i have one more content in same event.
i think will it helps you i think to retrive
java.net.SocketTimeoutException: Read timed out

"msgQueryString":"com.wm.app.b2b.server.ServiceException: java.net.SocketTimeoutException: Read timed out\n\

0 Karma

gcusello
SplunkTrust
SplunkTrust

try now

\"[^\"]*\"\:\".*\s(?<your_field>java[^\"]*)

see https://regex101.com/r/eNg0P0/3

Bye.
Giuseppe

0 Karma

sravankaripe
Communicator

got it thanks

0 Karma
Get Updates on the Splunk Community!

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...

Cloud Platform & Enterprise: Classic Dashboard Export Feature Deprecation

As of Splunk Cloud Platform 9.3.2408 and Splunk Enterprise 9.4, classic dashboard export features are now ...