Thursday, June 24, 2010

One-liner for errors per hour in a rolling log4j log

Because I keep forgetting valid syntax and having an example is very very handy:



for h in $(seq 0 23); do hh=$(printf "%02d" $h);  echo $hh $(grep "^2010-06-24 $hh.*general exception" some-dir?/ALogFile?.log* | wc -l); done;

No comments:

Post a Comment