X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=djbdns%2Ftinydns.py;h=9635360e1472f419c79e10d86c805be8a59dd3d1;hb=f2dc3c2bcec782de9931ec881b6fd64d8a10956e;hp=2d9741ed8cf92765afbb9d602fc837de6b1a69e5;hpb=49ee5a403cafc02a8e398c840b9bbc4c9d9e0f72;p=djbdns-logparse.git diff --git a/djbdns/tinydns.py b/djbdns/tinydns.py index 2d9741e..9635360 100644 --- a/djbdns/tinydns.py +++ b/djbdns/tinydns.py @@ -1,3 +1,6 @@ +r""" +Functions and data specific to tinydns logs. +""" # Don't clobber the global compile() with a named import. import re @@ -71,10 +74,9 @@ def handle_tinydns_log(line : str) -> Optional[str]: request_id = int(request_id, 16) # Convert the "type" field to a human-readable record type name - # using the query_type dictionary. If the right name isn't present - # in the dictionary, we use the (decimal) type id instead. - query_type = int(query_type, 16) # "001c" -> 28 - query_type = QUERY_TYPE_NAME.get(query_type, type) # 28 -> "aaaa" + # using the query_type dictionary. + query_type = int(query_type, 16) # "001c" -> 28 + query_type = QUERY_TYPE_NAME.get(query_type) # 28 -> "aaaa" line_tpl = "{timestamp} "