Afternoon Experts.
I have a Log file that is populated with Errors. Here is a Condensed Version :
*****2015-05-19 17:10:23,536 [ajp-0.0.0.0-8009-31] (TqlBuilder.java:347) ERROR - DUMMY From TqlBuilder getQueryDefinition
java.lang.Exception
xxxxxxx
xxxxxxxxx
xxxxxxx
2015-05-19 17:10:23,588 [ajp-0.0.0.0-8009-31] (TqlBuilder.java:348) ERROR - DUMMY From SqlBuilder
java.lang.Exception
xxxx
xxxx
xxxx
xxxxxxxx
2015-05-19 17:10:23,598 [ajp-0.0.0.0-8009-31] (TqlBuilder.java:351) ERROR - Bla Bla Bla java.lang.Exception xxxx xxxx xxxx xxxxxxxx**
I would like to come up with a Bash-Based Solution (been trying with grep, but with limited success) to pass this Log through a Blacklist File populated with (list of examples errors below), to clean the original file of these errors and produce a new file with all the errors from the blacklist cleared, along with the Lines that follow.
Here is an Example of my Blacklist
(TqlBuilder.java:347) ERROR - DUMMY From TqlBuilder getQueryDefinition
(TqlBuilder.java:348) ERROR - DUMMY From SqlBuilder
Using plain grep I was able to remove just the lines, but I need a Solution to remove the lines that follow the Error. I thought of having grep remove all lines between the Date 'Tags' but I was not able to figure out how to go about that.
My Expected output for the new, cleaned file after applying the original against the blacklist, would be:
**2015-05-19 17:10:23,598 [ajp-0.0.0.0-8009-31] (TqlBuilder.java:351) ERROR - Bla Bla Bla
java.lang.Exception
xxxx
xxxx
xxxx
xxxxxxxx**