[Logcheck-devel] removing empty lines

Thomas E. Horner logcheck.org at t-horner.com
Thu Oct 1 04:39:41 UTC 2015


Hi list,

when rebooting my ubuntu server usually generates a logcheck email that 
looks as if it was empty because it contains a *lot* of empty lines on 
top. Usually - at least for me - empty lines are not of any help so i 
feel those empty lines should be removed.

Please find the following diff that i think should be integrated into 
logcheck:


root at www:/usr/sbin# diff -u logcheck.org logcheck
--- logcheck.org    2015-10-01 06:33:09.331932123 +0200
+++ logcheck    2015-09-30 09:25:15.017110224 +0200
@@ -682,7 +682,8 @@
   # First sort the logs to remove duplicate lines (from different 
logfiles with
   # the same lines) and reduce CPU and memory usage afterwards.
   debug "Sorting logs"
-$SORT "$TMPDIR/logoutput"/* | sed -e 's/[[:space:]]\+$//' | cat  \
+$SORT "$TMPDIR/logoutput"/* | sed -e 's/[[:space:]]\+$//' | sed -e 
'/^$/d' | cat  \
       > "$TMPDIR/logoutput-sorted" \
           || error "Could not output to $TMPDIR/logoutput-sorted."


Br,
    Thomas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3703 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.alioth.debian.org/pipermail/logcheck-devel/attachments/20151001/07dbdb61/attachment-0001.bin>


More information about the Logcheck-devel mailing list