From e38ffea6b4a810f0dcdff0b836b5604ee296ebdc Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 07 2021 18:52:23 +0000 Subject: Handle the situation where the Matcher stops matching Signed-off-by: Pierre-Yves Chibon --- diff --git a/parse-access-log.py b/parse-access-log.py index 30d3e57..2538ded 100755 --- a/parse-access-log.py +++ b/parse-access-log.py @@ -108,7 +108,11 @@ def main(): # Duplicate data check (for sqlite output) if args.dupcheck: - item = next(match_iter) # grab first matching item + try: + item = next(match_iter) # grab first matching item + except StopIteration: + # If there is no next match, keep going + continue if args.writer.has_item(item): # if it's already in the db... continue # skip to next log else: # otherwise