-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Setting Output Data Timezone with --tz but without %z #2796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Good catch! Right now, it expects a |
Hi @allinurl, Thanks for the quick response. I think that is a reasonable way to handle it and would cover my case. There could be other cases where a users logs don't specify the time zone but default to the servers local time. Then the user wants to convert to a different time zone from the servers local time. If you took the approach you mentioned then goaccess would assume the wrong time zone of UTC and the conversion would be incorrect. I'm not sure how common that would be, if at all. I'd think most servers would specify the time zone if it wasn't UTC so the user could use %z in the --time-format parameter for their case. Thanks |
So after double checking this, it appears that the time will be converted to the specified timezone, regardless of whether e.g.,
here's an example: Let me know if that solves the issue for you. |
I'm just stopping by here to confirm that this solution does indeed work. Can we add a note to the documentation of the EDIT: Actually, I'm not sure it fully works. While it fixed the "Time Distribution" graph for me, the "Unique visitors per day" graph looks exactly the same. Here's the command I used:
|
@pencil can you post a few lines from your access logs so I can try to replicate this on my end with the exact same data? Thanks |
Hi,
I'm using goaccess 1.9.3. My web server logs use UTC as the timezone for the date and time, however the timezone is not specified in the log itself. For example, a line of my log looks like
2025-02-26 00:41:54 <app name> GET ...
I'd like my goaccess report to be given in Pacific time zone. For this I thought I could run goaccess with the following parameters
goaccess <log file> --time-format %H:%M:%S --date-format %Y-%m-%d --log-format "%d %t %^ %m %U %^ %^ %^ %h %u %^ %R %^ %s %^ %^ %b %^ %L" --tz=America/Los_Angeles -o tmp.csv
However when I run the command above, I'm still getting reports in UTC time.
For example, in the general panel I see the date the report was generated as 2/25/2025 17:08, which is the correct time I generated the report since I'm in Pacific time. But when I view the the other panels, the visitors panel shows 2/26/2025 and the visit_time panel shows 00, which is the corresponding time of the UTC logs, so they weren't converted.
Am I understanding the purpose of the --tz argument correctly and am I using it correctly? If not is there a way to achieve what I want?
Thank you
The text was updated successfully, but these errors were encountered: