Just some simple hints: (still in TODO…)
Command | Explanation |
---|---|
grep -i 'ERROR:' *.log|less | You must be in directory with server logs. Command shows you lines with text "error:" (ignores big/small letters). Command "less" is used for pagination - you can list in output using pgdn/ pgup. |
grep -i 'ERROR:' -A 3 *.log|less | shows you the same lines as in first example and also 3 following lines. |
grep -i 'extra data' *.log|awk ' {print tolower($0)}'|awk 'BEGIN {FS="error:";}{print $2}'|sort|uniq | This construct will show you unique error texts from log files. Just to see what is going on... |
for f in *.log; do echo " "; echo $f; grep -i 'error:' $f|awk ' {print tolower($0)}'|awk 'BEGIN {FS="error: ";}{print $2}'|sort|uniq; done|less | This simple "one-line-script" goes over all log files, displays name of the log file and unique error messages found in it. And makes pagination using "less". Also intended just for quick overview. |
grep "execution" cronjob.log |sort -k12 -r|less | This is a litte bit specialized command for cron jobs log we have. This log has some format and I needed to find slowest logged execution times. |