From: Sarah Hoffmann Date: Sun, 3 May 2015 11:20:35 +0000 (+0200) Subject: take ip6 addresses into account for log regex X-Git-Tag: deploy~463 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/4498b89a7501f95a41113e8d4086f7d750c8e2c0 take ip6 addresses into account for log regex --- diff --git a/utils/cron_ipanalyse.py b/utils/cron_ipanalyse.py index aba5e510..4dddb1cf 100755 --- a/utils/cron_ipanalyse.py +++ b/utils/cron_ipanalyse.py @@ -58,8 +58,8 @@ BLOCK_LIMIT = BLOCK_LOWER time_regex = r'(?P\d\d)/(?P[A-Za-z]+)/(?P\d\d\d\d):(?P\d\d):(?P\d\d):(?P\d\d) [+-]\d\d\d\d' -format_pat= re.compile(r'(?P[(\d\.)]+) - - \['+ time_regex + r'] "(?P.*?)" (?P\d+) (?P\d+) "(?P.*?)" "(?P.*?)"') -time_pat= re.compile(r'[(\d\.)]+ - - \[' + time_regex + '\] ') +format_pat= re.compile(r'(?P[a-f\d\.:]+) - - \['+ time_regex + r'] "(?P.*?)" (?P\d+) (?P\d+) "(?P.*?)" "(?P.*?)"') +time_pat= re.compile(r'[a-f\d:\.]+ - - \[' + time_regex + '\] ') logtime_pat = "%d/%b/%Y:%H:%M:%S %z"