Blame scripts/shared/applybinddate

Packit 57988d
#############################################################################
Packit 57988d
#Copyright (c) 2004, Sparta, Inc
Packit 57988d
#All rights reserved.
Packit 57988d
#
Packit 57988d
#Redistribution and use in source and binary forms, with or without
Packit 57988d
#modification, are permitted provided that the following conditions are met:
Packit 57988d
#
Packit 57988d
#*  Redistributions of source code must retain the above copyright notice,
Packit 57988d
#   this list of conditions and the following disclaimer.
Packit 57988d
#
Packit 57988d
#*  Redistributions in binary form must reproduce the above copyright
Packit 57988d
#   notice, this list of conditions and the following disclaimer in the
Packit 57988d
#   documentation and/or other materials provided with the distribution.
Packit 57988d
#
Packit 57988d
#*  Neither the name of Sparta, Inc nor the names of its contributors may
Packit 57988d
#   be used to endorse or promote products derived from this software
Packit 57988d
#   without specific prior written permission.
Packit 57988d
#
Packit 57988d
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
Packit 57988d
#IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
Packit 57988d
#THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
Packit 57988d
#PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
Packit 57988d
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
Packit 57988d
#EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
Packit 57988d
#PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
Packit 57988d
#OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
Packit 57988d
#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
Packit 57988d
#OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
Packit 57988d
#ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 57988d
#############################################################################
Packit 57988d
Packit 57988d
#############################################################################
Packit 57988d
# These scripts were created as part of the dnssec-tools project.
Packit 57988d
# For more information, see http://sourceforge.net/dnssec-tools.
Packit 57988d
# Detailed instructions for setting up BIND 9.3.* to use these logwatch
Packit 57988d
# configuration files and scripts are containted in the README file
Packit 57988d
# on sourceforge.
Packit 57988d
#############################################################################
Packit 57988d
Packit 57988d
use Logwatch ':dates';
Packit 57988d
Packit 57988d
# This will pick out only the wanted date from a logfile
Packit 57988d
# in the format used by BIND 9.*.
Packit 57988d
Packit 57988d
$SearchDate = TimeFilter('%d-%b-%Y %H:%M:%S');
Packit 57988d
Packit 57988d
if ( $ENV{'LOGWATCH_DEBUG'} > 5 ) {
Packit 57988d
   print STDERR "DEBUG: Inside ApplyBindDate...\n";
Packit 57988d
   print STDERR "DEBUG: Range: " . $ENV{'LOGWATCH_DATE_RANGE'} . "\n";
Packit 57988d
   print STDERR "DEBUG: Looking For: " . $SearchDate . "\n";
Packit 57988d
}
Packit 57988d
Packit 57988d
while (defined($ThisLine = <STDIN>)) {
Packit 57988d
   if ($ThisLine =~ m/^$SearchDate\.\d{3} /o) {
Packit 57988d
      print $ThisLine;
Packit 57988d
   }
Packit 57988d
}
Packit 57988d
Packit 57988d
# vi: shiftwidth=3 syntax=perl tabstop=3 et
Packit 57988d
# Local Variables:
Packit 57988d
# mode: perl
Packit 57988d
# perl-indent-level: 3
Packit 57988d
# indent-tabs-mode: nil
Packit 57988d
# End: