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.
Comments