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

realtime html and zcat #500

Closed
SimonVillage opened this issue Aug 27, 2016 · 8 comments
Closed

realtime html and zcat #500

SimonVillage opened this issue Aug 27, 2016 · 8 comments

Comments

@SimonVillage
Copy link

Hi there,

how can I use -real-time-html with zcat?

my current command is the following:
sudo zcat -f /var/log/nginx/bla.log /var/log/nginx/foo.log | sudo goaccess -o /var/www/stats/report.html --real-time-html

it creates the report.html but has no websocket running.
using this command without zcat and -f *.log works perfectly.

also is there a way to start goaccess on boot / as deamon?

@allinurl
Copy link
Owner

Hello,

Great question, currently goaccess disables the real-time functionality when reading from stdin. This will be addressed on issues #428 and filtering in #117. In the meantime, a workaround is to output to a new log file and use that to feed goaccess.

As far as starting goaccess as a service, there are a few ways of doing this, please take a look at this post.

Let me know if that helps.

@SimonVillage
Copy link
Author

Maybe it will be possible in a new version to add two files to goaccess without using zcat.
Like goaccess -f file1.log file2.log -o report.html --real-time-html

For one log file --real-time-html work without any issues.

@allinurl
Copy link
Owner

Thanks for the suggestion! Actually #459 is also part of it. I'm hoping I can get to this in one of the upcoming versions. Closing this for now as it will be addressed in one of the issues mentioned above. Stay tuned.

@allinurl
Copy link
Owner

allinurl commented Feb 27, 2017

@TAiS46 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:

goaccess --log-format=COMBINED access.log access.log.1 -o report.html --real-time-html

or

tail -f access.log | goaccess --log-format=COMBINED -

or even

tail -f access.log | goaccess --log-format=COMBINED -o report.html --real-time-html -

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.

@binaryhq
Copy link

binaryhq commented Feb 28, 2017

is there any way to make it work with zcat and websocket.?

zcat -f /var/log/apache2/access* | goaccess --log-format=COMBINED -o /var/www/html/report.html --real-time-html --ws-url=server.ip -p /etc/goaccess.conf not creating websocket

@allinurl
Copy link
Owner

@Ningappa zcat will probably close the pipe once it has finished reading the logs, you probably want to parse the current log by passing it to goaccess instead and use zcat for previous logs. Note, this hasn't been pushed out, but will be pushed out in the upcoming release, e.g.,

zcat -f /var/log/apache2/access.log.* | goaccess --log-format=COMBINED -o /var/www/html/report.html --real-time-html --ws-url=server.ip -p /etc/goaccess.conf /var/log/apache2/access.log -

@allinurl
Copy link
Owner

allinurl commented Mar 1, 2017

@Ningappa Just pushed a commit that should allow you to run the command I posted above (live stats and zcat). Feel free to build from development to this out before is shipped in the upcoming version.

@binaryhq
Copy link

binaryhq commented Mar 1, 2017

@allinurl thanks. it's working. 👍

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