X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=bin%2Fdjbdns-logparse.py;h=40a301200d8a84cadd253810db8684bb0b304844;hb=02e712134a0145311d91a34a87b002322405e24c;hp=f2a69b5a333a6b4fb3c421661bd158972d988144;hpb=2229f66e203e85bb804e13b1ced7f60fb77b119b;p=djbdns-logparse.git diff --git a/bin/djbdns-logparse.py b/bin/djbdns-logparse.py index f2a69b5..40a3012 100755 --- a/bin/djbdns-logparse.py +++ b/bin/djbdns-logparse.py @@ -166,7 +166,7 @@ def decode_client(words : list, i : int): id = int(chunks[2], 16) words[i] += f" (id {id})" -def decode_ip(words, i): +def decode_ip(words : list, i : int): r""" Helper function to decode the ip field in a dnscache log entry. @@ -206,18 +206,18 @@ def decode_ip(words, i): """ words[i] = convert_ip(words[i]) -def decode_ttl(words, i): +def decode_ttl(words : list, i : int): words[i] = f"TTL={words[i]}" -def decode_serial(words, i): +def decode_serial(words : list, i : int): serial = int(words[i]) words[i] = f"#{serial}" -def decode_type(words, i): +def decode_type(words : list, i : int): qt = words[i] words[i] = query_type.get(int(qt), qt) -def handle_dnscache_log(line) -> typing.Optional[str]: +def handle_dnscache_log(line : str) -> typing.Optional[str]: """ Handle a single log line if it matches the ``dnscache_log_re`` regex.