]> git.openstreetmap.org Git - nominatim.git/commitdiff
take ip6 addresses into account for log regex
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 3 May 2015 11:20:35 +0000 (13:20 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 3 May 2015 11:20:35 +0000 (13:20 +0200)
utils/cron_ipanalyse.py

index aba5e510b3b50cee2ff867755f6e3251527f6f2a..4dddb1cf35447d8e20612574293843650cf14709 100755 (executable)
@@ -58,8 +58,8 @@ BLOCK_LIMIT = BLOCK_LOWER
 
 time_regex = r'(?P<t_day>\d\d)/(?P<t_month>[A-Za-z]+)/(?P<t_year>\d\d\d\d):(?P<t_hour>\d\d):(?P<t_min>\d\d):(?P<t_sec>\d\d) [+-]\d\d\d\d'
 
-format_pat= re.compile(r'(?P<ip>[(\d\.)]+) - - \['+ time_regex + r'] "(?P<query>.*?)" (?P<return>\d+) (?P<bytes>\d+) "(?P<referer>.*?)" "(?P<ua>.*?)"')
-time_pat= re.compile(r'[(\d\.)]+ - - \[' + time_regex + '\] ')
+format_pat= re.compile(r'(?P<ip>[a-f\d\.:]+) - - \['+ time_regex + r'] "(?P<query>.*?)" (?P<return>\d+) (?P<bytes>\d+) "(?P<referer>.*?)" "(?P<ua>.*?)"')
+time_pat= re.compile(r'[a-f\d:\.]+ - - \[' + time_regex + '\] ')
 
 logtime_pat = "%d/%b/%Y:%H:%M:%S %z"