]> gitweb.michael.orlitzky.com - djbdns-logparse.git/blobdiff - bin/djbdns-logparse.py
bin/djbdns-logparse.py: use a variable to simplify a string template.
[djbdns-logparse.git] / 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}"