#766 Skipping entries does not work with IIS

6.9
open
nobody
5
2014-07-03
2009-09-29
Ferenc Veres
No

There is a part in the code which skips already processed lines. I tested with 6.7, but 6.9 code looks similar, in awstats.pl:

Can we try a direct seek access in log ?

..
if ( $LastLine && $LastLineNumber && $LastLineOffset && $LastLineChecksum )
..
seek( LOG, $LastLineOffset, 0 );

This means, that #Field definitions of the file are skipped if seeking occurs. If there are #Fields in the file and there is no skipping, they are processed and respected in processing the line.

If seeking happens, because the file was processed before, the following 2 things can happen:

  1. There is a #Fields line within the next 50 lines, and processing will skip some lines and then continue after #Fields.
  2. If there is no #Fields in the next 50 lines, the program stops with "wrong log file format" message

Since perl seek() command won't allow the program to find #Field definitions at all, I simply complately disabled seeking if format is IIS:

Diff:

  • if ($LastLine && $LastLineNumber && $LastLineOffset && $LastLineChecksum)
  • if ($LastLine && $LastLineNumber && $LastLineOffset && $LastLineChecksum && $LogFormat ne '2')

Discussion

  • Ferenc Veres
    Ferenc Veres
    2012-08-01

    I think this is still valid in 7.0. (Didn't test 7.1 yet.)