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!

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

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...