Loading...


Related Products


Date Published: February 5, 2025

goaccess access.log analysis on a production environment

In this article we will be going over a quick example on how to use goaccess to analyze the Apache access.log in a production Acquia Cloud Platform environment.
Make sure to replace content in [] with your specific use case

On ACE production environments there are two or more instances which means that we first need to copy the access.logs you would like to analyze on a shared location.

Create a folder named goaccess-logs in the shared location /home/[example]/prod :

example@ded-123:~/prod$ mkdir goaccess-logs
example@ded-123:~/prod$ cd ~/prod/goaccess-logs

Now copy the access.logs you would like to analyze and rename them for the first instance (you can narrow down your selection by replacing [datestring] for example, access.log-2020* will grab all available logs for 2020):

example@ded-123:~/prod/goaccess-logs$ cp /var/log/sites/[example].[env]/logs/[ded-123]/access.log-[datestring]* ~/prod/goaccess-logs/
example@ded-123:~/prod/goaccess-logs$ for f in access.log-[datestring]* ; do mv -- "$f" "$(hostname -a).$f" ; done

Repeat the above for all the production web instances you want to include in your analysis

Now you can use goaccess  to analyze the prod access.logs :

example@ded-123:~/prod/goaccess-logs$ zcat [web-*/ded-*] | 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!

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation
Back to Site navigation