I want the developers to get a mail with Java stack traces on a daily bases. When something is flaged as known issue and will get a fix but mean while this does not need to get sent each dayl. This is what I got so far. It's a bash script that runs some AWK in it.
To get the files that needs to be parsed
WORK_LOG="$(find $APP_DATA/log/ -maxdepth 1 -newermt "1 days ago" ! -newermt "00:00")"
This is working. All stack traces contains "exception:" string and can be x lines untill a INFO log message accurs and we stop printing.
awk '/excepeion\:/{p=1;print;next} p&&/UTC Level INFO Scope/{p=0};p' $WORK_LOG #>> output_test.log
Now what I need is to get rid of line containing known errors string so next part of awk don't catch them. I will give developers ability to paste strings that will be ignored into a config file
KNOW_EXCEPTION1="known error"
What I'm trying to do is get awk to remove the known exception rows before the print from here to here part.
awk '!/'"$KNOW_EXCEPTION1"'/{print $1} /excepeion\:/{p=1;print;next} p&&/UTC Level INFO Scope/{p=0};p'$WORK_LOG >> output_test.log
This I found through google but I need to work it into what I already have and I can't get it to work.
awk '!/known error/'