[Logwatch-Devel] patch to removeheaders 1.14

Markus Lude lude at informatik.uni-tuebingen.de
Fri Dec 30 18:43:38 MST 2005


On Fri, Dec 23, 2005 at 01:42:36PM +1100, David Baldwin wrote:
> I wrote a new filter (for pubcookie if anyone is interested - can 
> contribute it) and the service name included white space "pubcookie login 
> server". Patch to 'removeheaders' script attached to handle that.

The removeheaders script now removes too much.
In log entries like:

... host service: foo: bar ...

" foo: " is removed too.

[^\[:] instead of [^\[] should fix this.

> David.
 
Regards,
Markus

> --- scripts/shared/removeheaders        30 Nov 2005 23:52:27 -0000      1.14
> +++ scripts/shared/removeheaders        23 Dec 2005 02:38:11 -0000
> @@ -17,8 +17,8 @@
> 
>  while (defined($ThisLine = <STDIN>)) {
>      #First line is Solaris ID tag style -mgt
> -    $ThisLine =~ s/^... .. ..:..:.. [^ ]* [^ ]*(\[\d*\])?: \[ID \d+( \w+\.\w+)?] //;
> -    $ThisLine =~ s/^... .. ..:..:.. [^ ]* [^ ]*(\[\d*\])?: //;
> +    $ThisLine =~ s/^... .. ..:..:.. [^ ]* [^\[]*(\[\d*\])?: \[ID \d+( \w+\.\w+)?] //;
> +    $ThisLine =~ s/^... .. ..:..:.. [^ ]* [^\[]*(\[\d*\])?: //;
>      # the following is for those logs that use the service name, but do not
>      # append the ':' right after (for example, syslogd restart).  Presumably
>      # OnlyService is called before RemoveHeaders, so this should only be done

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
Url : http://ip70-176-100-107.ph.ph.cox.net/pipermail/logwatch-devel/attachments/20051230/e04aba36/attachment.bin


More information about the Logwatch-Devel mailing list