]> gitweb.michael.orlitzky.com - djbdns-logparse.git/commitdiff
bin/djbdns-logparse.py: use a variable to simplify a string template.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 16 Sep 2022 00:26:32 +0000 (20:26 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 16 Sep 2022 00:26:32 +0000 (20:26 -0400)
bin/djbdns-logparse.py

index 4f440d2a2ddee4450e627842601ebc69b7a58e4d..8f30e1430cbfa1e8c6f9af11e398f5159d3ebd75 100755 (executable)
@@ -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}"