Visualize metrics of your web traffic by using your ELB logs with GoAccess
437
This Docker container provides a bridge between the logs produced by the AWS Elastic LoadBalancer and the real-time web log analyzer GoAccess. It basically fetches all the log files stocked on an AWS S3 Bucket and generates html reports on these datas.
This tutorial considers that you already have an AWS Elastic LoadBalancer configured and that he already writes it's logs to an S3 Bucket. If your ELB is not already storing it's logs to an S3 Bucket, you can activate it by following these few simple steps (2 minutes):
All these tools are already presents in the container (sorted from logs to client)
Once at runtime and then every $REFRESH_DELAY (explained in the Installation part of this doc) seconds, is done the following:
/data directory/var/www/html/index/html fileBefore using this image, we invite you to consider that mounting a volume to the /data folder is an unnecessary step. On the other hand, this will permit you having a persistent logs folder, resulting in not having to sync down all the log files from your S3 Bucket each time you will start the service. These files will be numerous. Very, very, numerous, so we really recommand mounting a volume to the /data folder.
The following environment variables are required for running this container:
s3://<Bucket>/<Prefix>/AWSLogs/<account_id>/elasticloadbalancing/<region>, where the Bucket is the Bucket in which you configured your ELB to store your log files, Prefix is mandatory, account_id is the id of the account owning the ELB (you can go to your S3 Bucket and check it out) and region is mandatory. In fact you could stop at the s3://<Bucket>/<Prefix>/ but we recommand at least going down to the elasticloadbalancing folder.docker pull webvoid/awselbtogoaccess:latestdocker run \
-p 80:80 \
-v ./data:/data \
-e AWS_ACCESS_KEY="<aws_api_access_key>" \
-e AWS_SECRET_KEY="<aws_api_secret_key>" \
-e HTTP_USER="<user_for_http_basic_auth>" \
-e HTTP_PASSWD="<password_for_http_basic_auth>" \
-e REFRESH_DELAY="<server_refresh_delay_in_seconds>" \
-e S3_LINK="<your_s3_bucket_link>" \
webvoid/awselbtogoaccess:latest
This image does not require any high cpu or ram amount to run, as it's only composed of a very basic nginx server with a few things around. The weakest configuration you can have will be more than enough.
/data folderOnce the container is fully launched, you can access it using http://<host>.
The auto-reload feature reloads automatically the page at regular intervals. To use it, simply go to http://<host>/?r=<interval> where interval is the number of seconds between each reload.
You can fetch and build this image from the associated github repository.
The files in the repository are organized as following:
You can build the image by browsing into the cloned directory with your terminal and run docker build . -t <image_tag>. More info on how to build an image on the Docker Reference.
Content type
Image
Digest
Size
122.4 MB
Last updated
over 9 years ago
docker pull webvoid/awselbtogoaccess