From 321ec9451afd9634a9b63f17b6b5555df962fdaa Mon Sep 17 00:00:00 2001 From: David Kitcher-Jones Date: Thu, 16 Jul 2020 20:22:55 +0100 Subject: [PATCH] Update filters.py Some log lines don't contain a 'path' field, so filter_path fails when it is used. Checking the value first prevents it from bailing out. --- haproxy/filters.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/haproxy/filters.py b/haproxy/filters.py index 1a295b3..e32337c 100644 --- a/haproxy/filters.py +++ b/haproxy/filters.py @@ -45,7 +45,9 @@ def filter_path(path): """ def filter_func(log_line): - return path in log_line.http_request_path + http_request_path = log_line.http_request_path + if http_request_path: + return path in log_line.http_request_path return filter_func