Skip to content

Instantly share code, notes, and snippets.

@fedek6 fedek6/matomo.bat
Created Jun 6, 2018

Embed
What would you like to do?
Automatic log parsing for matomo using Bat
@echo off
:: Based on https://matomo.org/docs/log-analytics-tool-how-to/
:: Global config
SET PY_BIN=C:\Program Files\Python\Python27\python.exe
SET IMPORT_LOGS=[path to matomo]\piwik\misc\log-analytics\import_logs.py
SET LOGS_DIR=C:\inetpub\logs\LogFiles
SET TOKEN=****************************
SET URL=http://website.com/piwik/
SET THREADS=2
:: Change this according to your system locale.
:: Current setting is based on dd.mm.yyyy format.
SET DAY=%date:~0,2%
SET MONTH=%date:~3,2%
SET YEAR=%date:~8,2%
:: Site 1
SET DIR=W3SVC3
SET ID=3
:: Zmienne generowane po dacie i ścieżkach
SET LOG_FILE=u_ex%YEAR%%MONTH%%DAY%.log
SET LOG_PATH=%LOGS_DIR%\%DIR%\%LOG_FILE%
"%PY_BIN%" "%IMPORT_LOGS%" --url=%URL% --idsite=%ID% --recorder-max-payload-size=200 --token-auth=%TOKEN% --recorders=%THREADS% --enable-http-errors --enable-http-redirects --enable-static --enable-bots "%LOG_PATH%"
@echo Parsed log file: %LOG_PATH%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.