Package: syslog-summary
Version: 1.14-2
Followup-For: Bug #609940

I set up another logserv today, so I found this bug again.
I've been using the monkey patch below,
but it looks like I never put it on this ticket.

    aptitude install -yq syslog-summary
    cp -p /usr/bin/syslog-summary /etc/syslog-summary.py
    dpkg-divert --rename /usr/bin/syslog-summary
    ln -s /etc/syslog-summary.py /usr/bin/syslog-summary
    etckeeper commit 'Make syslog-summary(1) a conffile, so it can be fixed.'
    sed -i /etc/syslog-summary.py \
        -e '1c#!/usr/bin/python' \
        -e 's/^datepats =.*/& re.compile(r"^[0-9T.:+-]{25,32} "),/'
    etckeeper commit 'Teach syslog-summary about granular timestamps (and 
python2.6).'
    echo SYSLOGSUMMARY=1 >>/etc/logcheck/logcheck.conf
    etckeeper commit 'Have logcheck use syslog-summary.'

I extended it to recognize and remove the timestamps that appear in
kern.log these days, see diff below.

    diff --git a/usr/bin/syslog-summary.distrib b/etc/syslog-summary.py
    index 17ad38b..a9a01dc 100755
    --- a/usr/bin/syslog-summary.distrib
    +++ b/etc/syslog-summary.py
    @@ -1,4 +1,4 @@
    -#!/usr/bin/env python2.5
    +#!/usr/bin/python
     # -*- coding: utf-8 -*-

     # Copyright © 2008-2009, David Paleino <d.pale...@gmail.com>
    @@ -43,11 +43,13 @@ from hashlib import sha1
     from optparse import OptionParser

     datepats = [
    +        re.compile(r"^[0-9T.:+-]{25,32} "), # RFC3339 timestamps
            re.compile(r"^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 
0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] "),
            re.compile(r"^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) 
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 
0-9][0-9][0-9][0-9]:[0-9][0-9] "),
            re.compile(r"^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) 
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 
0-9][0-9][0-9][0-9]:[0-9][0-9]:[0-9][0-9] "),
     ]
     pidpat = re.compile(r"^([^ ]* [^ ]*)\[[0-9][0-9]*\]: ")
    +pidpat = re.compile(r"^([^ ]* [^ ]*)(\[[0-9]+\]:|: \[[ 0-9.]+\]) ") # 
match pids OR printk timestamps
     repeatpat = re.compile(r"^[^ ]* last message repeated (\d+) times$")

     ignore_pats = []


-- System Information:
Debian Release: 8.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'testing-updates'), (500, 'unstable'), 
(1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.14-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to