posting as an answer because pasting is bad in a comment. Essentially I want to take the below input
2012-02-10 13:04:51,208 [http-0.0.0.0-8080-252] ERROR Rejecting request due
2012-02-10 13:04:51,348 [http-0.0.0.0-8080-29] ERROR [NOTIFY]: some error
lots of stuff
fdsfasdkfljdskfsadjd
fsadjklfjsdaklfasdjf
fsjadklfjsdalkfjdsaklfjsd
2012-02-10 13:05:06,895 [http-0.0.0.0-8080-298] ERROR [org.apache.commons.beanutils.PropertyUtils] Method invocation failed.
java.lang.IllegalArgumentException: java.lang.ClassCastException@73afa6d1
at sun.reflect.GeneratedMethodAccessor275.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
2012-02-10 13:04:45,873 [http-0.0.0.0-8080-151] ERROR [site.mismatch.DupDetection] Rejecting request due
2012-02-10 13:04:51,208 [http-0.0.0.0-8080-252] ERROR [site.mismatch.DupDetection] Rejecting request due
and I want to break it into the following events - for clarification I'll separate with ##########
2012-02-10 13:04:51,208 [http-0.0.0.0-8080-252] ERROR Rejecting request due
##########
2012-02-10 13:04:51,348 [http-0.0.0.0-8080-29] ERROR [NOTIFY]: some error
lots of stuff
fdsfasdkfljdskfsadjd
fsadjklfjsdaklfasdjf
fsjadklfjsdalkfjdsaklfjsd
##########
2012-02-10 13:05:06,895 [http-0.0.0.0-8080-298] ERROR [org.apache.commons.beanutils.PropertyUtils] Method invocation failed.
java.lang.IllegalArgumentException: java.lang.ClassCastException@73afa6d1
##########
at sun.reflect.GeneratedMethodAccessor275.invoke(Unknown Source)
##########
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
##########
at java.lang.reflect.Method.invoke(Method.java:597)
##########
at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
##########
2012-02-10 13:04:45,873 [http-0.0.0.0-8080-151] ERROR [site.mismatch.DupDetection] Rejecting request due
##########
reason being is I then want to match any line starting with ^\s and throw it away (getting rid of the java stack trace), and it looks like you can only throw away whole events, not partial events. Technically the 4 "at" lines were part of the IllegalArgumentException that preceded it, but I don't want it because in real life, there's 80 more "at" lines that follow and they are not interesting to me.
... View more