-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
real-time with multiple log #600
Comments
Currently there's no way to have the real-time functionality when piping multiple log files. This will be addressed in #428 and #459. As you said, a workaround would be to tail multiple logs and append them to a new log file and feed that to GoAccess. However, just to clarify log rotation, GoAccess will display the the contents of the new log file as in the case of |
Ok ! Waiting for it. For people with the same problem, I found a workaround in the mean time. My service script contains a first line for parsing the old files and save it to the database, and the second launches goaccess in real time :
With this method I can restart the service (or reboot) without double parsing and the real-time is working with the old data too. |
I've pushed a commit that enables the ability to output live stats from a stream or an unclosed STDIN, i.e., tail -f as well as parsing multiple logs in live mode:
or
or even
It also opens the possibility for live data filtering from the pipe such as:
One thing to note is that tail -f will keep the pipe opened even when goaccess has already exited. For instance, Feel free to build from master to test this out, otherwise it will be pushed out in the upcoming release. Thanks. |
Hi all,
Is there a way to have the real-time mode with a log in multiple files (log rotation) like access.log.0, access.log.1, ...? I use nginx, but it is not specific to it and should be a common problem.
It is easy without real-time as we can just aggregate all log and run the program on it.
The problem is that if I just use -f access.log.0 I do not have my old data (and not sure that when the log rotation is done it will keep the current data?). Or if I restart goaccess I would loose the old data.
One way I found was to load the aggregation of the old files with --keep-db, and then start goaccess with --read-from-disk and --keep-db but if I restart it multiple times the same day, the data from acess.log.0 is -re-read and kept multiple times. So still not a solution.
Another way would be to have an external program always running which takes all old files and tail the current one. But it seems a little over-kill.
Thanks,
Tom
The text was updated successfully, but these errors were encountered: