darold / squidanalyzer

Squid Analyzer parses Squid proxy access log and reports general statistics about hits, bytes, users, networks, top URLs, and top second level domains. Statistic reports are oriented toward user and bandwidth control.
http://squidanalyzer.darold.net/
125 stars 36 forks source link

An option to force logfile parsing from start #181

Closed zeft2016 closed 6 years ago

zeft2016 commented 6 years ago

Hi Darold,

I must thank you for your tremendous efforts you put on this project. However, there is only one request I have that I cannot use your software without: I need to be able to override all kinds/sorts/types of logfile sanity checking, PLUS override all kinds/sorts/types of "history_offset" sanity checking that SquidAnalyzer.pm does.

Why? Because however how much clever your code is, there will always be something different. Although I'm not much into perl, I tried to do that myself, but your checks are deeply rooted everywhere, which ends my efforts with a "No new file registered..."

This is a deal-breaker to me, if you are not willing to help, I might just ask someone else to do it for me, or sorrowfully abandon your software.

Your help is so much appreciated.

darold commented 6 years ago

Hi,

I can add this feature but what state do you want to reach after log parsing: preserve the old history offset or the new one generated from the log parsed?

Best regard.

darold commented 6 years ago

Commit 4f0b3a7 adds this feature. There is now two new command line options described as follow:

--skip-history       : used to not take care of the history file. Log parsing offset will
                              start at 0 but old history file will be preserved at end.
                             Useful if  you want to parse and old log file.
--override-history : when skip-history is used the current history file will be overridden
                              by the offset of the last log file parsed.

Please use latest development code and let me know if that's corresponding to your request.

zeft2016 commented 6 years ago

Thank you for such an awesome response. It is amazing that I still get "No new log registered..." when using the --skip-history option.

The thing I really wanted is: to parse a file regardless of any presumed condition. What could be standing in the way?

Attached is a sample log that fails all the way, with or without new options (trimming done for privacy reasons). Maybe it is not history offset after all?!

example.log

darold commented 6 years ago

Yes sorry I forgot to apply change to method new(), last commit f1afa03 might solve the problem.

zeft2016 commented 6 years ago

Thank you @darold so much 👍 👍 👍

You don't know how much you made my life easier.