Log-File Analyse: the selected log format doesn't include the hostname

Hallo,
ich versuche mich das erste mal mit der Log-File Analyse von Matomo, erhalte aber den Fehler:

Fatal error: the selected log format doesn’t include the hostname: you must specify the Matomo site ID with the --idsite argument

Bei meiner Anwendung handelt es sich um eine Multidomain-Seite. Die Logs aller Domains stehen in einer Log-Datei. Jeder Eintrag steht dort in folgender Form:

0.0.0.0 - - [20/Oct/2020:23:42:58 +0200] "GET /path HTTP/1.1" 200 4833 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0" www.domain.de
...

Was ist zu tun, damit das Log-File eingelesen wird und die Einträge den richtigen Websites zugewiesen werden.

Danke
Stephan

Falls jemand bei Mittwald hosted und auch Probleme wie oben hat, dem hilft wahrscheinlich das: https://www.typo3-nürnberg.de/html/suchmaschinen/matomo/

Regex:

(?P<ip>\S+) \S+ \S+ \[(?P<date>.*?) (?P<timezone>.*?)\] \"\S+ (?P<path>.*?) \S+\" (?P<status>\S+) (?P<length>\S+) "(?P<referrer>\S+)" "(?P<user_agent>.*)" (?P<host>\S+)

python Aufruf:

python /home/www/p123456/html/matomo/misc/log-analytics/import_logs.py --url=https://matomo.example.com --log-format-regex='(?P<ip>\S+) \S+ \S+ \[(?P<date>.*?) (?P<timezone>.*?)\] \"\S+ (?P<path>.*?) \S+\" (?P<status>\S+) (?P<length>\S+) "(?P<referrer>\S+)" "(?P<user_agent>.*)" (?P<host>\S+)' --add-sites-new-hosts /logs/access.log
1 Like

Danke für die Idee! Ich hab das gleiche gerade für IONOS nachgestellt und teile kurz den String:
python3 import_logs.py --url=https://analytics.example.com --add-sites-new-hosts --log-format-regex='(?P<ip>\S+) \S+ \S+ \[(?P<date>.*?) (?P<timezone>.*?)\] \"\S+ (?P<path>.*?) \S+\" (?P<status>\S+) (?P<length>\S+) (?P<host>\S+) \S+ \"(?P<user_agent>.*?)\"' /logs/access.log