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
224 stars 118 forks source link

Infinite loop in log format detection #304

Open sth opened 3 years ago

sth commented 3 years ago

import_logs.py gets stuck in an infinite loop in log format detection in this example (Matomo v4.1.1):

echo '# test' > somefile
python3 misc/log-analytics/import_logs.py --url=http://localhost/ somefile

It tries to read lines at end of file in this loop: https://github.com/matomo-org/matomo-log-analytics/blob/78613990160194afbd2d18792858c2d154480605/import_logs.py#L291-L295