procmail
[Top] [All Lists]

Re: Matching repeating lines?

1997-02-11 12:12:41
Lars's last version of the sed command:

| sed -e '$!N' -e '/[^ ]*  *[^ ]*  *[^ *]  *[^ ]*  *\(.*\)\n.*\1/!P' -e D
                                    ^^^^^
Shouldn't that be [^ ]* like the others?

It might be easier to pick out the message by counting colons in the
timestamp than words up through the hostname.  If the time is immediately
to the left of the hostname,

  '/^[^:]*:..:[0-5][0-9]  *[^ ]*  *\(.*\)\n.*\1/!P'

If there is some other colon to the left of the timestamp (if the line
begins "syslog:" or something), adjust accordingly.

<Prev in Thread] Current Thread [Next in Thread>