Analyzing Apache Access Logs with GoAccess Instead of Webalizer or Analog

2022-09-08 09:44 (2 years ago) ytyng

I wanted to check the usage status of functions on an old server running Apache from the access logs.

About 20 years ago, tools like Analog and Webalizer were available for analyzing access logs. I wondered how it is in today's world, and upon investigation, I found GoAccess.

It can be installed via apt and runs in the terminal. It can also output in HTML, which suited my needs.

Since the service is running on Kubernetes, I copied the log to my Mac.

podname=$(kubectl -n my-namespace \
get pod -l app=my-app-name \
-o jsonpath="{.items[0].metadata.name}")

kubectl -n my-namespace cp \
${podname}:/var/log/apache2/access.log \
${HOME}/Downloads/my-service-access.log

Then, I started GoAccess with Docker to create the HTML.

cat ${HOME}/Downloads/my-service-access.log | \
docker run --rm -i -e LANG=$LANG allinurl/goaccess \
-a -o html --log-format COMBINED - > report.html

Reference: GoAccess - Downloads

It's very convenient and works great.

Currently unrated

Comments

Archive

2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011