In this article we will be going over a quick example on how to use goaccess to analyse the apache access.log in a non production Acquia Cloud Platform environment.
Make sure to replace content in []
with your specific use case
For non production environments which rely on a single instance to serve traffic analysing the logs with goaccess is relatively simple.
First you SSH to the appropriate environment example.env
and navigate to the access.log
location.
In order to analyse the logs you need to pass them to goaccess
together with the appropriate log format. For example:
example@staging-123:/var/log/sites/[example].[env]/logs/staging-123$ cat access.log | goaccess --log-format=COMBINED -o ~/report.html
... or if you would like to check historical gziped logs:
example@staging-123:/var/log/sites/[example].[env]/logs/staging-123$ zcat access.log | goaccess --log-format=COMBINED -o ~/report.html
The report is now available for you to download using the same methods described here but with the location being /home/[example]/report.html
instead.
Note that you can actually place the report.html
to a location which is served by your sites like /var/www/html/example.env/docroot/sites/default/files
by modifying the above command and then view the result from your browser. Be careful you may want to add http authentication to that as it will be publicly available !