

log" rm " $TEMP_OUTPUT " AWStats Configuration #!/bin/bash LOG_DIR = "/local/DATA/aws_cloudfront_logs" # create an empty output file TEMP_OUTPUT = "/tmp/temp_merged. The critical outcome is that the everything is combined into one file and that the logs are sorted by timestamp. The result of this script could have been accomplished in other ways.

There's some extra nonsense in there to mark each gzip file as "done" so I don't read the same log messages over and over. The sorting could have been done with but I chose not to do it that way. The script sorts the logs, as properly sorted logs are necessary for AWStats to work. The bash script also does some data cleaning to remove the unneeded columns and comments. Instead I wrote a bash script to read each gzip file one at a time and append to a single merged log file. bash: /usr/bin/gzip: Argument list too long One could try to combine them with a command like zcat *.gz > /tmp/combined_logs.log but there are too many little files for that to work: $ gzip *.gz > /tmp/combined_logs.log The second step is to combine all of the data into one log file. My use of the -exclude and -include parameters limit the syncing to files from this year. The log data is stored in many small gzip files.
#Awstats io code
This accomplishes the same task as the Python code in that other blog post I found.
#Awstats io download
I use the aws s3 sync command to download only new log files to my computer. Standard CloudFront logging writes the log files to a S3 bucket. Obviously the first step is to obtain the log files. This blog post will document what I learned while getting this to work for me.

#Awstats io how to
I was able to find a single blog post from 2011 documenting how to process CloudFront logs with AWStats, and although that post was helpful, I believe more needs to be said about how to shoehorn CloudFront logs into something AWStats can use. That isn't the case when using CloudFront. The AWStats documentation seems to assume that you are using AWStats on the actual web server generating the logs, or at least that you have access to normal web server logs. |_Output for 'uname -a':Linux 2.4.How does one use AWStats to analyze AWS CloudFront logs?ĪWStats is a widely used tool to analyze website logs, but unfortunately there is not much information available on how to use it with AWS's (Standard) CloudFront logs. Nmap -sV -script http-awstatstotals-exec.nse Example Usage nmap -sV -script http-awstatstotals-exec.nse -script-args 'http-awstatstotals-exec.cmd="uname -a", http-awstatstotals-exec.uri=/awstats/index.php' See the documentation for the smbauth library. smbdomain, smbhash, smbnoguest, smbpassword, smbtype, smbusername See the documentation for the http library. http.host, http.max-body-size, http.max-cache-size, http.max-pipeline, http.pipeline, uncated-ok, eragent See the documentation for the slaxml library. eragent - User Agent to use in GET request bug Other useful args when running this script: Default: whoami http-awstatstotals-exec.outfile Default: /index.php http-awstatstotals-exec.cmdĬommand to execute. Script Arguments http-awstatstotals-exec.uriĪwstats Totals URI including path. The script queries the web server with the command payload encoded using PHP's This vulnerability can be exploited through the GET variable sort. Script Arguments Example Usage Script Output Script http-awstatstotals-execĮxploits a remote code execution vulnerability in Awstats Totals 1.0 up to 1.14Īnd possibly other products based on it (CVE: 2008-3922).
