From c15dd1fe414f6c26f692d327362021dcf26081c0 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 14 Sep 2022 21:20:47 -0400 Subject: [PATCH] doc/README: siphon the description and history from bin/djbdns-logparse. --- bin/djbdns-logparse | 21 --------------------- doc/README | 46 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 21 deletions(-) create mode 100644 doc/README diff --git a/bin/djbdns-logparse b/bin/djbdns-logparse index 998f547..2e184d8 100755 --- a/bin/djbdns-logparse +++ b/bin/djbdns-logparse @@ -3,27 +3,6 @@ Convert tinydns and dnscache logs to human-readable form """ -# -# Reads log files from tinydns and/or dnscache and prints them out in -# human-readable form. Logs can be supplied on stdin, or listed on the -# command line: -# -# $ cat @*.s | djbdns-logparse -# $ djbdns-logparse @*.s -# $ tail -f current | djbdns-logparse -# -# Pipes each log file through tai64nlocal, which must be on your path. -# -# Acknowledgments: -# -# * The log format descriptions by Rob Mayoff were invaluable: -# ** http://dqd.com/~mayoff/notes/djbdns/tinydns-log.html -# ** http://dqd.com/~mayoff/notes/djbdns/dnscache-log.html -# -# * Faried Nawaz's dnscache log parser was the original inspiration: -# ** http://www.hungry.com/~fn/dnscache-log.pl.txt -# - import re from struct import pack from time import strftime, gmtime diff --git a/doc/README b/doc/README new file mode 100644 index 0000000..07e52b3 --- /dev/null +++ b/doc/README @@ -0,0 +1,46 @@ +djbdns-logparse: convert tinydns and dnscache logs to human-readable form + +== What is it? == + +djbdns is Daniel J. Bernstein's suite of DNS software from, + + https://cr.yp.to/djbdns.html + +Two of its daemons, tinydns and dnscache, resolve DNS queries while +simultaneously logging obscure gibberish to a file. For example, this +is what tinydns logs if I request the 'A' record for www.example.com: + + @4000000063227a320c4f3114 7f000001:9d61:be69 - 0001 www.example.com + +djbdns-logparse converts these into something that you can actually +read. The line above gets turned into, + + 2022-09-14 21:04:40.206516500 dropped query (no authority) from + 127.0.0.1:40289 (id 48745): a www.example.com + +and surely you agree that this is preferable. + + +== Requirements == + +There are only two: + + a) python-3.6 or later, for f-strings support + b) the tai64nlocal program from djbdns in your PATH + + +== History == + +This is a modernish fork of Greg Ward's parse_djbdns_log program +from, + + https://www.gerg.ca/hacks/parse_djbdns_log + +The original was inspired by Faried Nawaz's dnscache log parser, + + http://www.hungry.com/~fn/dnscache-log.pl.txt + +with heavy assistance from Rob Mayoff's documentation: + + * https://www.dqd.com/~mayoff/notes/djbdns/tinydns-log.html + * https://www.dqd.com/~mayoff/notes/djbdns/dnscache-log.html -- 2.43.2