cronjob for import logs every 5 minutes /etc/cron.d/matomo-logtail: Processing idsite 12 mycloud /var/log/apache2/. Processing idsite 5 myothersite /var/log/apache2/31 lines. Processing idsite 1 mysite /var/log/apache2/12 lines. Run test matomo-logtail.sh from matomo-logtail.sh SITE_LOG_FILE="/var/log/apache2/IMPORT_LOGS_SITE_OPT="-enable-reverse-dns -enable-bots" IMPORT_LOGS_OPT="-config=config/ -recorders=4 -enable-static"Ĭreate a configfile for your every matomo website instance, for example /etc/matomo-logtail/mysite.sitecfg:
Enhanced by the Debian Logcheck TeamIMPORT_LOGS_BIN="/usr/local/bin/import_logs.py" The original logtail was written in C by Craig H. MATOMO_URL=" MATOMO_LOGTAIL_WORKDIR="/var/lib/matomo-logtail" Priate number of bytes from the end of logfile, assuming that all changes that are made to it are to add new characters to it.ĭownload matomo-logtail.sh and copy to /usr/local/binĬreate global configfile for matomo-logtail /etc/matomo-logtail/matomo-logtail.cfg: Logtail2 reads a specified file (usually a log file) and writes to the standard output that part of it which has not been read by previous runs of logtail2. The script uses logtail2 to read logfiles and feed matomo with new lines. With this script it is possible to continuous import serverlogs to matomo by cronjobs. Serverlogs automatically rotated every day. On GitHub Site Matomo Server Log Analytics is recommended to import Script to continuous import serverlogs to matomo with logtail