From e57cab082be0eef4738b0217015c22172831623e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 15 Sep 2022 20:26:32 -0400 Subject: [PATCH] bin/djbdns-logparse.py: use a variable to simplify a string template. --- bin/djbdns-logparse.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/djbdns-logparse.py b/bin/djbdns-logparse.py index 4f440d2..8f30e14 100755 --- a/bin/djbdns-logparse.py +++ b/bin/djbdns-logparse.py @@ -297,7 +297,11 @@ def handle_dnscache_log(line) -> typing.Optional[str]: elif event in ("tcpopen", "tcpclose"): decode_client(words, 0) - return f"{timestamp} {event} " + " ".join(words) + # Reconstitute "data" (i.e. everything after the timestamp and the + # event) from "words", which was originally obtained by splitting + # "data". + data = " ".join(words) + return f"{timestamp} {event} {data}" -- 2.44.2