AWStats reading -n hours from a log file with - as delimiter

  • Igor Ljubuncic
    Igor Ljubuncic
    2013-12-23

    Hi guys,

    All is peachy but one thing.

    My logfiles look like log-%yyyy-%mm-%dd-%hh (I have no control here).

    If I specify this format, awstats can't find data, because the log files are created an hour back.
    So I need to use %HH-n to get the right hour. Unfortunately, with "-" as delimiter this does not work.

    Any suggestions how I could work around this and get awstats to parse delimiter and hour operator correctly at the same time. If the log delimiter was "_", it would have worked great, and the math for hours backward is correct.

    I tried concatenating strings. No luck. Or I'm not smart enough.

    I even considered adding a regex into awstats.pl to parse the log file and use a special delimiter instead of the real one and correct if after reading the conf file, but not quite sure if it's going to work. Or where exactly to tinker.

    Any suggestions?

    Igor