]> gitweb.michael.orlitzky.com - djbdns-logparse.git/log
djbdns-logparse.git
20 months agobin/djbdns-logparse.py: remove unused time imports.
Michael Orlitzky [Fri, 16 Sep 2022 00:23:49 +0000 (20:23 -0400)]
bin/djbdns-logparse.py: remove unused time imports.

20 months agobin/djbdns-logparse.py: localize subprocess imports.
Michael Orlitzky [Fri, 16 Sep 2022 00:22:46 +0000 (20:22 -0400)]
bin/djbdns-logparse.py: localize subprocess imports.

20 months agobin/djbdns-logparse.py: more docs for convert_ip().
Michael Orlitzky [Fri, 16 Sep 2022 00:20:19 +0000 (20:20 -0400)]
bin/djbdns-logparse.py: more docs for convert_ip().

20 months agobin/djbdns-logparse.py: add docstring for decode_client().
Michael Orlitzky [Fri, 16 Sep 2022 00:13:17 +0000 (20:13 -0400)]
bin/djbdns-logparse.py: add docstring for decode_client().

20 months agobin/djbdns-logparse.py: use f-strings for all string interpolation.
Michael Orlitzky [Thu, 15 Sep 2022 23:49:49 +0000 (19:49 -0400)]
bin/djbdns-logparse.py: use f-strings for all string interpolation.

20 months agobin/djbdns-logparse.py: fix python3 integer division for txt records.
Michael Orlitzky [Thu, 15 Sep 2022 23:49:21 +0000 (19:49 -0400)]
bin/djbdns-logparse.py: fix python3 integer division for txt records.

20 months agobin/djbdns-logparse.py: refactor handle_* types again.
Michael Orlitzky [Thu, 15 Sep 2022 23:18:01 +0000 (19:18 -0400)]
bin/djbdns-logparse.py: refactor handle_* types again.

Instead of using True/False to signal success after possibly using
print() to actually write the result, we not just return either the
processed string, or None.

20 months agobin/djbdns-logparse.py: add docstring for handle_dnscache_log().
Michael Orlitzky [Thu, 15 Sep 2022 23:02:22 +0000 (19:02 -0400)]
bin/djbdns-logparse.py: add docstring for handle_dnscache_log().

20 months agobin/djbdns-logparse.py: more doctests for handle_tinydns_log().
Michael Orlitzky [Thu, 15 Sep 2022 23:01:16 +0000 (19:01 -0400)]
bin/djbdns-logparse.py: more doctests for handle_tinydns_log().

20 months agobin/djbdns-logparse.py: move regex handling down a level.
Michael Orlitzky [Thu, 15 Sep 2022 22:50:26 +0000 (18:50 -0400)]
bin/djbdns-logparse.py: move regex handling down a level.

It was a bit awkward to match a line against a regex, and then to have
to immediately pass that match object into a function that knows what
to do with it (to avoid duplicating work). Now the handle_tinydns_log()
and handle_dnscache_log() functions create the match object themselves,
and signal success or failure by returning a boolean.

20 months agobin/djbdns-logparse.py: add a docstring for main().
Michael Orlitzky [Thu, 15 Sep 2022 15:23:00 +0000 (11:23 -0400)]
bin/djbdns-logparse.py: add a docstring for main().

20 months agobin/djbdns-logparse.py: rework some of the tinydns logic.
Michael Orlitzky [Thu, 15 Sep 2022 15:20:36 +0000 (11:20 -0400)]
bin/djbdns-logparse.py: rework some of the tinydns logic.

20 months agobin/djbdns-logparse.py: add doctest for parse_logfile().
Michael Orlitzky [Thu, 15 Sep 2022 14:15:46 +0000 (10:15 -0400)]
bin/djbdns-logparse.py: add doctest for parse_logfile().

20 months agobin/djbdns-logparse.py: add comment about open file descriptors.
Michael Orlitzky [Thu, 15 Sep 2022 14:01:07 +0000 (10:01 -0400)]
bin/djbdns-logparse.py: add comment about open file descriptors.

20 months agobin/djbdns-logparse.py: add docs for parse_logfile().
Michael Orlitzky [Thu, 15 Sep 2022 13:46:16 +0000 (09:46 -0400)]
bin/djbdns-logparse.py: add docs for parse_logfile().

20 months agobin/djbdns-logparse.py: drop unused _cvt_ip()/_cvt_port() functions.
Michael Orlitzky [Thu, 15 Sep 2022 13:31:27 +0000 (09:31 -0400)]
bin/djbdns-logparse.py: drop unused _cvt_ip()/_cvt_port() functions.

20 months agobin/djbdns-logparse.py: use f-strings for regex patterns; add comments.
Michael Orlitzky [Thu, 15 Sep 2022 13:30:18 +0000 (09:30 -0400)]
bin/djbdns-logparse.py: use f-strings for regex patterns; add comments.

20 months agobin/djbdns-logparse.py: add docs/examples for handle_tinydns_log().
Michael Orlitzky [Thu, 15 Sep 2022 03:10:48 +0000 (23:10 -0400)]
bin/djbdns-logparse.py: add docs/examples for handle_tinydns_log().

20 months agobin/djbdns-logparse.py: fiddle with the convert_ip() comments.
Michael Orlitzky [Thu, 15 Sep 2022 03:10:17 +0000 (23:10 -0400)]
bin/djbdns-logparse.py: fiddle with the convert_ip() comments.

20 months agobin/djbdns-logparse.py: add some newer type mappings.
Michael Orlitzky [Thu, 15 Sep 2022 02:53:37 +0000 (22:53 -0400)]
bin/djbdns-logparse.py: add some newer type mappings.

I've added srv, naptr, dnskey, tlsa, https, and caa type mappings
based on what my own logs contain. Only SRV is actually supported by
tinydns. There are probably others in use today that will show up
eventually.

20 months agobin/djbdns-logparse.py: add .py extension and doctests for convert_ip().
Michael Orlitzky [Thu, 15 Sep 2022 01:30:53 +0000 (21:30 -0400)]
bin/djbdns-logparse.py: add .py extension and doctests for convert_ip().

Without the rename, "python -m doctest" isn't smart enough to figure
out that this thing is a python file.

20 months agodoc/README: siphon the description and history from bin/djbdns-logparse.
Michael Orlitzky [Thu, 15 Sep 2022 01:20:47 +0000 (21:20 -0400)]
doc/README: siphon the description and history from bin/djbdns-logparse.

20 months agobin/djbdns-logparse: only import sys.stdin within main().
Michael Orlitzky [Thu, 15 Sep 2022 00:54:35 +0000 (20:54 -0400)]
bin/djbdns-logparse: only import sys.stdin within main().

20 months agobin/djbdns-logparse: remove unused warn() function.
Michael Orlitzky [Thu, 15 Sep 2022 00:54:17 +0000 (20:54 -0400)]
bin/djbdns-logparse: remove unused warn() function.

20 months agobin/djbdns-logparse: fix line splitting in tinydns output.
Michael Orlitzky [Thu, 15 Sep 2022 00:51:00 +0000 (20:51 -0400)]
bin/djbdns-logparse: fix line splitting in tinydns output.

20 months agobin/djbdns-logparse: use argparse for arg parse.
Michael Orlitzky [Thu, 15 Sep 2022 00:44:09 +0000 (20:44 -0400)]
bin/djbdns-logparse: use argparse for arg parse.

20 months agoInitial commit, just starting to organize everything.
Michael Orlitzky [Thu, 15 Sep 2022 00:11:03 +0000 (20:11 -0400)]
Initial commit, just starting to organize everything.