matomo-org / matomo-log-analytics

Import any kind of server logs in Matomo for powerful log analytics. Universal log file parsing and reporting.
https://matomo.org/log-analytics/
GNU General Public License v3.0
226 stars 118 forks source link

Bulk Import Apache2 Logfiles #223

Open Rom41n opened 6 years ago

Rom41n commented 6 years ago

How would anyone approach importing multiple Apache2 access logs? I've tried to add the flag --add-sites-new-hosts but it couln't figure out the virtual hostname. So i went to edit the Logformat from: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common To: LogFormat "%h %l %u %t %{Host}i \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common

Which will output the following: dev.local 10.0.0.1 - - [10/Oct/2018:12:31:13 +0200] dev.local "GET / HTTP/1.1" 200 3264 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0"

But it throws: 0 requests imported successfully 0 requests were downloads 23 requests ignored: 0 HTTP errors 0 HTTP redirects 23 invalid log lines

MrBenGriffin commented 3 years ago

I'm just adding each filename as a parameter, and it seems to work fine.