Skip to content
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

Tailing multiple log files on terminal #459

Closed
szepeviktor opened this issue Jul 1, 2016 · 5 comments
Closed

Tailing multiple log files on terminal #459

szepeviktor opened this issue Jul 1, 2016 · 5 comments

Comments

@szepeviktor
Copy link
Contributor

szepeviktor commented Jul 1, 2016

Our server has several vhosts.
How is it possible to use the interactive viewer with multiple files?

goaccess -f vhost1.log -f vhost2.log # does not work currently

Thank you.

@szepeviktor szepeviktor changed the title Tailing multiple lofg files on terminal Tailing multiple log files on terminal Jul 1, 2016
@allinurl
Copy link
Owner

allinurl commented Jul 4, 2016

Currently it is not possible to tail multiple files. Doing a # zcat -f access.log* | goaccess disables the tail functionality. Please keep this open so I can take a look at it. Thanks

@Codmic
Copy link

Codmic commented Dec 23, 2016

I was also looking for this feature. When using Direct Admin, access log file names are like "domain.com.log" and the error log "domain.com.error.log". Because of this I cannot use something like "goaccess -f /var/log/nginx/domains/*.log" because it also tries to parse the error logs. Now I use the zcat option but unfortunately this breaks the very nice realtime function. It would be great if the filename could also be given using a regex.

@allinurl
Copy link
Owner

@Codmic You are right. Currently there's no way to have the real-time functionality when piping/zcat multiple log files. This will be addressed in #428.

@allinurl
Copy link
Owner

allinurl commented Feb 27, 2017

I've pushed a few commits that give 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. For example:

goaccess --log-format=COMBINED vhost1.log vhost2.log access.log*

It also opens the possibility for live data filtering from the pipe such as:

tail -f access.log | grep -i --line-buffered 'firefox' | goaccess --log-format=COMBINED -

Feel free to build from master to test this out, otherwise it will be pushed out in the upcoming release. Thanks.

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Feb 27, 2017

Very well done.

This is huge advantage in goaccess.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants