log-search: Compare lowered terms to lowered log line.

This allows us to search for upper-case things.
This commit is contained in:
Alex Vandiver 2023-03-22 15:58:29 +00:00 committed by Tim Abbott
parent 90205a490d
commit b2666bf054
1 changed files with 2 additions and 1 deletions

View File

@ -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: