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

Wrong Date in access log #208

Closed mikes-gh closed 3 years ago

mikes-gh commented 5 years ago

I am parsing the squid log using cron.hourly. At some stage around midnight the script is adding a day to the timestamps it collects. I think it is something to do with BST (british summer time which is currently 1hr ahead of UTC

The effect is that when parsing the log a log entry that is dated

Jun 05 23:57:55 Is recorded as Jun 06 23:57:55

This also has the effect of setting the history time stamp wrongly and no more records are collected for that day.

In my conf I have

TimeZone +00

And squid logs should be in UTC

But system time will be in BST = UTC + 1

Sorry this is so vague not sure where to start

darold commented 5 years ago

According to commit 1bfd73c you must comment out theTimeZone configuration directive:

#TimeZone +00

and of course use latest development code.

mikes-gh commented 5 years ago

OK done will report back tomorrow to confirm if it solves the issue Thanks

mikes-gh commented 5 years ago

Same thing after commenting out Timezone It seems after 11pm squidanalyser thinks it is the next day. Once this happens all collection stops as the .current file is in the future

dcruz1990 commented 4 years ago

I have similar issue, but here, squidanalyzer shows a different hour.. for example:

Current datetime: Tue Feb 4 13:28:31 CST 2020

SquidAnalyzer logs: Feb 04 16:48:11

Will it have something to do with the system being in CST and the squid logs in UTC?

darold commented 4 years ago

Are you using latest development code?