From b2666bf054b187988b0559ae3fc317a5408a96da Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Wed, 22 Mar 2023 15:58:29 +0000 Subject: [PATCH] log-search: Compare lowered terms to lowered log line. This allows us to search for upper-case things. --- scripts/log-search | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/log-search b/scripts/log-search index 64496114eb..a16ec1d823 100755 --- a/scripts/log-search +++ b/scripts/log-search @@ -185,6 +185,7 @@ def main() -> None: print("! nginx logs not suggested for timeline, due to imprecision", file=sys.stderr) use_color = sys.stdout.isatty() + lowered_terms = [term.lower() for term in args.filter_terms] try: for logfile_name in reversed(logfile_names): with maybe_gzip(logfile_name) as logfile: @@ -192,7 +193,7 @@ def main() -> None: # As a performance optimization, just do a substring # check before we parse the line fully lowered = logline.lower() - if not all(f in lowered for f in args.filter_terms): + if not all(f in lowered for f in lowered_terms): continue if args.nginx: