Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Error exception if hostname in logfile is empty = Python script loops forever #126
Log Import throw me a Pyhon error exception on specific Log lines that came from Host Spoofed GET calls. It doesn't really matter if the loglines getting logged by Apache, Nginx or Varnishncsa. If spammer calling an GET Request with empty Host Header, it will be logged like that.
In the case with empty Host variable, the python script is looping forever until you kill the process by hand which is annoying since you need to manual interfere in the hanging cronjob every day.
Here is the error exception from import_logs.py:
Here you can see the regex i use with the log-line which cause import_logs.py to freak out: https://regex101.com/r/fM8iC2/1
Piwik Log import should skip such lines or replace on insert it with host = unknown e.g.