Skip to content

Pass AWS CloudFront Logs directly to matomo logfile analysis

License

Notifications You must be signed in to change notification settings

marketing-factory/aws_cf2matomo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

aws_CfLogs

Bash-Skript to download CloudFront Logs and pass them to matomo

You can run this skript ether directly on the matomo server or you can pass the logfiles via matomo API to matom from another server.

Author: Ingo Schmitt

Support and more: https://github.com/marketing-factory/aws_cf2matomo

Install

  • Clone this repository
  • Install locally matomo import skriptimport_logs.py
  • install awscli
  • create a matomo API Token for passing the logs to matomo when matomo is not running on the same machine

Usage

usage: getLogs.sh: -s SOURCES3BUCKET -d DESTS3BUCKET -p AWSPROFILE -m MATOMOURL -l MATOMOLOGPARSER -i MATOMOSITE -a MATOMOAPITOKEN [-r AWSREGION]

  • -s SOURCES3BUCKET Source S3 Bucket where the logs are stored
  • -d DESTS3BUCKET Destination S3 Bucket where the analysed logs are moved to
  • -p AWSPROFILE aws cli profile for the connection
  • -r AWSREGION AWS Region for S3 Buchet, default eu-central-1
  • -m MATOMOURL Url for Matomo
  • -l MATOMOLOGPARSER path to matomo Logparser import_logs.py
  • -i MATOMOSITE Matomo Site ID
  • -a MATOMOAPITOKEN Matomo API Token

Help on Install

awscli

awscli is needed for downloading the files. So install it directly from AWS, as docker image (https://docs.aws.amazon.com/cli/latest/userguide/getting-started-docker.html) or via your distribution.

aws cli on Mac can be installed by brew. brew install awscli

Matomo Token

  • Add IP of remote server to matomo config.ini.php to prevent brute force detection while parsing logs
  • Create an "inscure" token!

About

Pass AWS CloudFront Logs directly to matomo logfile analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages