Java StackTrace Regex Help - Overclock.net - An Overclocking Community

Forum Jump: 

Java StackTrace Regex Help

 
Thread Tools
post #1 of 3 (permalink) Old 10-26-2016, 11:16 AM - Thread Starter
New to Overclock.net
 
Buster's Avatar
 
Join Date: Sep 2004
Posts: 1,519
Rep: 4 (Unique: 4)
Tomcat Console Logs
INFO | jvm 1 | main | 2016/10/25 21:51:57.009 | Oct 25, 2016 9:51:56 PM org.apache.catalina.core.StandardWrapperValve invoke
INFO | jvm 1 | main | 2016/10/25 21:51:57.009 | SEVERE: Servlet.service() for servlet [springmvc] in context with path [/hac] threw exception [Filter execution threw an exception] with root cause
INFO | jvm 1 | main | 2016/10/25 21:51:57.009 | java.lang.IllegalAccessError:
INFO | jvm 1 | main | 2016/10/25 21:51:57.009 | at de.hybris.platform.oauth2.AuthSuccessListener$$dtt.dt_23_onApplicationEvent_28(Unknown Source)
INFO | jvm 1 | main | 2016/10/25 21:51:57.009 | at de.hybris.platform.oauth2.AuthSuccessListener.onApplicationEvent(AuthSuccessListener.java:34)
INFO | jvm 1 | main | 2016/10/25 21:51:57.009 | at de.hybris.platform.oauth2.AuthSuccessListener.onApplicationEvent(AuthSuccessListener.java:1)


I need help writing a regex to determine the start of a new log event. Normally, this regex ‘^[^\s]' would work. But I am trying to combine Java stacktrace logs into one log event (highlighted). So far I have this regex '[a-zA-Z]{3,}.*\d{4}\/\d{2}\/\d{2}\s\d{2}:\d{2}:\d{2}.\d{3}\s\|\s+at|Exception:|Caused by:' which would match the body of a typical Java stacktrace logs. I don't know how or if it is possible to say to match everything except for the regex pattern. Please help.

Buster is offline  
Sponsored Links
Advertisement
 
post #2 of 3 (permalink) Old 10-26-2016, 11:37 AM
New to Overclock.net
 
takoma's Avatar
 
Join Date: Sep 2016
Posts: 29
Rep: 0
Can't you just process every line in your log and remember the ones your regex does not match?
That is to say if your match is null, then it must be the event you are interested in.

takoma is offline  
post #3 of 3 (permalink) Old 10-26-2016, 12:19 PM - Thread Starter
New to Overclock.net
 
Buster's Avatar
 
Join Date: Sep 2004
Posts: 1,519
Rep: 4 (Unique: 4)
I am shipping my logs through AWS CloudWatch and the regex is meant for 'multi_line_start_pattern' configuration (http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AgentReference.html). There are no programming code in it.

Buster is offline  
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the Overclock.net - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off