How to import log file to Matomo?


(John) #1

I’m trying to import the log files to Matomo but really much help from the read-me file or in the tutorial. Based on information provided i have tried below command but getting error.


D:\Projects\temp>python C:\xampp\htdocs\analystics\misc\log-analytics\import_logs.py --url=https://test.com/analytics/index.php --user=admin --password=admin --idsite=6 daily.2019-04-10-0.log
2019-04-16 19:18:32,811: [INFO] Error when connecting to Matomo: <urlopen error [Errno 11001] getaddrinfo failed>
2019-04-16 19:18:32,811: [INFO] Retrying request, attempt number 2
2019-04-16 19:18:42,826: [INFO] Error when connecting to Matomo: <urlopen error [Errno 11001] getaddrinfo failed>
2019-04-16 19:18:42,842: [INFO] Retrying request, attempt number 3
2019-04-16 19:18:52,858: [INFO] Error when connecting to Matomo: <urlopen error [Errno 11001] getaddrinfo failed>
2019-04-16 19:18:52,858: [INFO] Max number of attempts reached, server is unreachable!
Traceback (most recent call last):
File “C:\xampp\htdocs\analystics\misc\log-analytics\import_logs.py”, line 2614, in
resolver = config.get_resolver()
File “C:\xampp\htdocs\analystics\misc\log-analytics\import_logs.py”, line 1079, in get_resolver
return StaticResolver(self.options.site_id)
File “C:\xampp\htdocs\analystics\misc\log-analytics\import_logs.py”, line 1603, in init
‘SitesManager.getSiteFromId’, idSite=self.site_id
File “C:\xampp\htdocs\analystics\misc\log-analytics\import_logs.py”, line 1586, in call_api
return cls._call_wrapper(cls._call_api, None, None, method, **kwargs)
File “C:\xampp\htdocs\analystics\misc\log-analytics\import_logs.py”, line 1573, in _call_wrapper
raise Matomo.Error(message, code)
main.Error: [Errno 11001] getaddrinfo failed

Actually link https://test.com/analytics/index.php is working from browser, so obviously Matomo is up & running.


(John) #2

I have added host name in the host file to run the import command. host file would be C:\Windows\System32\drivers\etc\host