How to visualize Access Logs with a fancy interface and charts

How to visualize Access Logs with a fancy interface and charts

Logs are important, you can push your logs to Logz.io as described here: How to forward Platform.sh logs to Logz.io

But what if you just want to visualize the Access Logs to have an overview of the visits? And what if you could do that from within your terminal and/or in your browser?

Introducing GoAccess.io! This tool is really handy and perfect to do that with no hassle.

Steps

Installation

Install the GoAccess locally. https://goaccess.io/download

It is available most of the Linux distribution, *BSD, even Slackware! Via Brew, or via Sources.

Just use it

Thanks to the platform CLI:

platform log access --tail | goaccess --log-format=COMBINED -

You will visualize in your terminal, or you can visualize it in your browser

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

And then just open the report.html file.

Bonus that’s realtime if you pass the option --real-time-html

Advanced

If you want to have the full log, you can also download the full access.log

platform ssh --all # to see the SSH_URL
scp SSH_URL:/var/log/access.log .
goaccess access.log --log-format=COMBINED -o report.html

That’s it!
Enjoy fancy Access Log visualization!

2 Likes