From 5786a38cec2c1068f9df414194b9720a5be53527 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Mon, 22 Jan 2024 16:42:49 +0000 Subject: [PATCH] log-search: Match against path without query parameters. The nginx logs have query parameters; display them, but do not use them for URL matching. --- scripts/log-search | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/log-search b/scripts/log-search index 57e5b17c07..8602caf621 100755 --- a/scripts/log-search +++ b/scripts/log-search @@ -130,7 +130,7 @@ NGINX_LOG_LINE_RE = re.compile( " (?P \S+ ) \s+ - (?P [^"]+ ) + (?P (?P [^"?]+ ) (\?[^"]*)? ) \s+ (?P HTTP/[^"]+ ) " \s+ @@ -159,7 +159,7 @@ PYTHON_LOG_LINE_RE = re.compile( (?P \d+ ) \s+ (?P \S+ ) \s+ # This can be "217ms" or "1.7s" ( \( [^)]+ \) \s+ )* - (?P /\S* ) \s+ + (?P (?P /\S* ) ) \s+ .* # Multiple extra things can go here \( (?P @@ -419,9 +419,9 @@ def print_line( color = FAIL if use_color: - url = f"{BOLD}{match['path']}" + url = f"{BOLD}{match['full_path']}" else: - url = match["path"] + url = match["full_path"] color = "" if FilterType.HOSTNAME not in filter_types: