Using Athena and Lambda to get daily notifications about your Cloudfront website requests
The problem After deploying this website I wanted to track the number of daily visitors. While Cloudfront provides default distribution metrics such as the total number of requests and error percentages, my focus was on obtaining the daily count of unique visitors.
Cloudfront logs offer numerous fields which offer insights into things such as the source IP, HTTP method, protocol version or response times. These logs are available in two formats: standard, which are delivered multiple times per hour, and real-time. Since my requirement was to analyze the daily number of requests without real-time constraints, I opted for standard logs for my query.