Log analytics, custom format, invalid log lines


I updated to the new version 1.9 now the log import can’t import my custum log.

My custom log format is:
LogFormat “%h “%{%Y-%m-%d %H:%M:%S}t” %v “%U” “%q” %<m %>s %b “%{Referer}i” “%{User-Agent}i”” vhost

I edited the file: piwik/misc/log-analytics/import_logs.py and added the follwing code:
’(?P[\d*.]) “(?P\d+[-\d+]+ [\d+:]+)” (?P\S+) "(?P.?)" “(?P<query_string>.?)" \w+ (?P\d+) (?P\S+) "(?P.?)” “(?P<user_agent>.*?)”’
and added the follwing to the Formats = {}:
‘vhost’: RegexFormat(‘vhost’, _CUSTOM_LOG_FORMAT),

The script found “vhost” as the matching format but imports nothing.
Instead the logs import summary shows “xxx invalid log lines”

where is the mistake?

Please ask in: Log analytics list of improvements · Issue #3163 · matomo-org/matomo · GitHub

But, we havent’ changed the script in 1.9