From: Michael Orlitzky Date: Fri, 16 Sep 2022 00:26:32 +0000 (-0400) Subject: bin/djbdns-logparse.py: use a variable to simplify a string template. X-Git-Tag: 0.0.1~33 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=e57cab082be0eef4738b0217015c22172831623e;p=djbdns-logparse.git bin/djbdns-logparse.py: use a variable to simplify a string template. --- 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}"