Browse Source

Update country parsing regex

master
Pekka Helenius 3 years ago
parent
commit
28e5328d0f
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      apache-logparser/logparser.py

+ 1
- 1
apache-logparser/logparser.py View File

@ -301,7 +301,7 @@ for file in files:
if not country_seen:
host_country_main = subprocess.check_output([geotool,'-d',geodb,entry_remote_host]).rstrip().decode()
host_country_main = host_country_main.split('\n')
host_country = re.sub(r"^.*, (.*)", r'\1', host_country_main[0])
host_country = host_country_main[0].split(', ')[1]
if re.search("Address not found", host_country):
host_country = "Unknown"


Loading…
Cancel
Save