diff --git a/alb-s3-sqs-es/alb_s3/ingester/message.py b/alb-s3-sqs-es/alb_s3/ingester/message.py index 313098c..5ceea73 100644 --- a/alb-s3-sqs-es/alb_s3/ingester/message.py +++ b/alb-s3-sqs-es/alb_s3/ingester/message.py @@ -69,7 +69,7 @@ def __init__(self, log_msg): self.message["client_port"] = client_ip[-1] # Parse User-Agent string - if self.message["user_agent"] is not None: + if "user_agent" in self.message: user_agent = parse(self.message["user_agent"]) user_agent_details = {} user_agent_details["browser"] = user_agent.get_browser()