Skip to content

Tool to locally download, sort, and parse Cloudfront standard logs into usable JSON format.

Notifications You must be signed in to change notification settings

sxtnkyl/CloudfrontStandardLogParser

Repository files navigation

Goal

For use with low traffic websites. Can be used to locally store logs and keep S3 buckets decluttered. Parse Cloudfront standard logs for valid JSON objects, sort into folders by date, and create two compiled jsons (bots and unique viewers) for a month's folder.

NOTE: compile by bots and unique viewers currently separate

Setup

Javascript

index.js

Creates a folder in working directory by date(year, month, day). First arguement should be a number keyAmount of files to download from your S3 bucket, defined in dotenv. Starts by oldest file in the bucket.

NOTE: Bucket must not have files nested in folders

node index.js 6

filterFolder.js

Optional usage- takes a folder of one month and organizes logs from bots from unique viewers into two json files (botVisitsByMonth01.json and visitorsByMonth01.json). Takes two arguements- yearand month. Year must be 4 chars, while month is 2 chars.

node filterFolder.js 2021 02 17

About

Tool to locally download, sort, and parse Cloudfront standard logs into usable JSON format.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published