#!/usr/bin/perl -w
##########################################################################
# $Id: removeservice,v 1.2 1998/02/23 01:17:04 kirk Exp $
##########################################################################
# $Log: removeservice,v $
# Revision 1.2  1998/02/23 01:17:04  kirk
# Getting ready for a first distribution
#
# Revision 1.1  1998/02/22 23:28:31  kirk
# Commented and rearranged some things
#
##########################################################################

########################################################
# This was written and is maintained by:
#    Kirk Bauer <kirk@kaybee.org>
#
# Please send all comments, suggestions, bug reports,
#    etc, to kirk@kaybee.org.
#
########################################################

# This will remove the unwanted service from a logfile
# in the standard /var/log/messages format.  Case insensitive

if ( $ENV{'LOGWATCH_DEBUG'} > 5 ) {
   print STDERR "DEBUG: Inside RemoveService...\n";
}

$ServiceName = $ARGV[0];

while (defined($ThisLine = <STDIN>)) {
    unless ( ($ThisLine =~ m/^... .. ..:..:.. [^ ]* $ServiceName\[[0123456789]*\]: /oi) or
             ($ThisLine =~ m/^... .. ..:..:.. [^ ]* $ServiceName: /oi) ) {
      print $ThisLine;
    }
}
