Hello,
I'm trying to process a log file like the following. Let's call it "log.txt"
2007-05-08 01:24:29,826 INFO - aaaaaaaaaa
2007-05-08 01:24:29,849 INFO - bbbbbbbbbbbb
2007-05-08 01:24:29,967 ERROR -
java.lang.Exception: etc
at xxx (xxx.java:95)
at zzz(zzzz.java:105)
2007-05-08 02:24:29,826 INFO - aaaaaaaaaa
2007-05-08 02:24:29,849 INFO - bbbbbbbbbbbb
2007-05-08 03:24:29,967 ERROR -
java.lang.Exception: error 2xxxx
at xxx (xxx.java:95)
at zzz(zzzz.java:105)
2007-05-08 03:24:29,826 INFO - aaaaaaaaaa
2007-05-08 03:24:29,849 INFO - bbbbbbbbbbbb
I would like to create a file with only the line that follows to the one which contains the text "ERROR -"
With grep 'ERROR -' > result.txt , i would get a new file with lines of the type:
2007-05-08 01:24:29,967 ERROR -
2007-05-08 03:24:29,967 ERROR -
What I would like is to get a new file that with the lines of the type:
java.lang.Exception: etc
java.lang.Exception: error 2xxxx
Any help or suggestion will be appreciated.
Regards,
Javier
