intelmq
intelmq copied to clipboard
HTTP collector: Log response size
Proposal for the HTTP collector log. Instead of
INFO - Downloading report from 'https://urlhaus.abuse.ch/feeds/tld/at/'.
log the size in parenthesis:
INFO - Downloading report from 'https://urlhaus.abuse.ch/feeds/tld/at/' (1.4 KB).
Then it's easy to see if a response was empty (0B, see also https://lists.cert.at/pipermail/intelmq-users/2021-February/000202.html) or very big.
len(response) will give the size in bytes (after unpacking). We can add a function to intelmq.lib.utils for size-conversion to get a human-readable size specifier.