From 90aed4a139ff7009bfebc632acb9bef90f6f171f Mon Sep 17 00:00:00 2001 From: Darold Gilles Date: Mon, 12 Oct 2015 13:26:01 +0200 Subject: [PATCH] Fix SquidAnalyzer fails to update statistics after cleanup of access.log. Thanks to mkhallaf for the report. --- SquidAnalyzer.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SquidAnalyzer.pm b/SquidAnalyzer.pm index 32172a4..728737b 100644 --- a/SquidAnalyzer.pm +++ b/SquidAnalyzer.pm @@ -658,6 +658,13 @@ sub parseFile $logfile->close; # This file should be ommitted jump to the next file next if ($line eq 'NOK'); + + print STDERR "DEBUG: new file: $lfile, start from the beginning.\n" if (!$self->{QuietMode}); + if (!$self->{is_squidguard_log}) { + $self->{end_offset} = 0; + } else { + $self->{sg_end_offset} = 0; + } } else { # move at offset and see if next line is older than history time $logfile->seek($history_offset, 0);