Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python
import fileinput
from ripe.atlas.sagan import DnsResult
def process(line):
result = DnsResult(line)
try:
print("{}\t{}\t{}\t{}".format(
result.created.strftime('%s'),
result.probe_id,
result.responses[0].response_time,
result.responses[0].abuf.answers[0].data[0]
)
)
except:
pass # brutal
for line in fileinput.input():
process(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment