- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 1
 
Manual log upload
        benoit74 edited this page Jun 3, 2025 
        ·
        6 revisions
      
    A few services are not using matomo directly but rely on an importer that parses web server logs and imports those into matomo.
Should this fail for any reason, we may need to manually re-import the logs. This describes the procedure.
- Must be one of download-kiwix, download-openzim, library-kiwix, demo-library-kiwix
 - Date(s) to re-import should be less than 30d (see downloads-logrotate)
 - Start manual-log-uploader and attach to shell
 - export 
MATOMO_SITE_IDto the site you're targeting - Logs for date YYYY-MM-DD is in file 
/var/log/nginx/<project>/access.log-YYYY-MM-<DD+1>.gz - Extract the gzip file 
gunzip -k <access.log-xxxx.gz>(you need to do it from the machine itself since FS is readonly from within container) - set 
LOG_PATHto full path of the extracted file - set 
HOSTto the domain-name of the website - run 
import-log 
Example for 2022-07-10:
kubectl apply -f zim/manual-log-uploader.job.yamlcd /var/log/nginx/download-kiwix
gunzip -k access.log-20220711.gz
MATOMO_SITE_ID=2 HOST=download.kiwix.org LOG_PATH=/var/log/nginx/download-kiwix/access.log-20220711 import-log
rm ./access.log-20220711kubectl delete job manual-log-uploaderMATOMO_SITE_ID=2 HOST=download.kiwix.org
MATOMO_SITE_ID=6 HOST=download.openzim.org
MATOMO_SITE_ID=13 HOST=library.kiwix.org
MATOMO_SITE_ID=16 HOST=browse.library.kiwix.org