Skip to content

Commit

Permalink
Excluding torrent clients from logs
Browse files Browse the repository at this point in the history
When importing raw HTTP logs into matomo,
we are now excluding all lines for which the user agent match a list of predefined
torrent clients.
The code looks for “excluded string” inside the “User-Agent” one which is why
our list consists only of names.
The list has been assembled from client names and not actual User-Agent
  • Loading branch information
rgaudin committed Feb 17, 2025
1 parent 2870c46 commit 36784fb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion matomo-log-analytics/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@ RUN { \
echo 'if [ ! -z "$USE_SUFFIXED_LOG" ] ; then' ; \
echo ' export LOG_PATH=$LOG_PATH-$(date +"%Y%m%d")' ; \
echo 'fi' ; \
echo 'import_logs.py --enable-http-redirects --include-host=$HOST --idsite=$MATOMO_SITE_ID --url=$MATOMO_URL --token-auth=$MATOMO_TOKEN $LOG_PATH' ; \
echo 'import_logs.py --useragent-exclude qbittorrent --useragent-exclude libtorrent \
--useragent-exclude vuze --useragent-exclude deluge --useragent-exclude utorrent \
--useragent-exclude bittorrent --useragent-exclude biglybt \
--useragent-exclude bitcomet --useragent-exclude bitlord \
--useragent-exclude frostwire --useragent-exclude kget \
--useragent-exclude ktorrent --useragent-exclude limewire \
--useragent-exclude mldonkey --useragent-exclude rtorrent \
--useragent-exclude robert --useragent-exclude shareaza --useragent-exclude tixati \
--useragent-exclude tonido --useragent-exclude transmission \
--useragent-exclude tribler --useragent-exclude xunlei \
--enable-http-redirects --include-host=$HOST --idsite=$MATOMO_SITE_ID --url=$MATOMO_URL --token-auth=$MATOMO_TOKEN $LOG_PATH' ; \
} > /usr/local/bin/import-log && chmod +x /usr/local/bin/import-log

CMD ["import-log"]

0 comments on commit 36784fb

Please sign in to comment.