mirror of
https://github.com/adulau/passive-dns-atlas.git
synced 2025-01-04 23:13:17 +00:00
Minimal statistics added
This commit is contained in:
parent
e32cab8ea4
commit
9302ce2306
1 changed files with 24 additions and 0 deletions
24
bin/get_stats.py
Normal file
24
bin/get_stats.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env python3
|
||||
# coding=utf-8
|
||||
#
|
||||
# passive-dns-atlas - basic stats extractor
|
||||
#
|
||||
# Experimental Passive DNS collector and stats from the RIPE Atlas Stream
|
||||
#
|
||||
# Free Software released under the GNU Affero General Public License v3.0
|
||||
|
||||
import redis
|
||||
from prettytable import PrettyTable
|
||||
|
||||
fieldsSagan = ['Type', 'Name', 'TTL', 'Class']
|
||||
limit = 100
|
||||
|
||||
r = redis.StrictRedis(host='localhost', port=6379)
|
||||
|
||||
for field in fieldsSagan:
|
||||
c = r.zrange(field.upper(), 0, limit, desc=True, withscores=True)
|
||||
table = PrettyTable()
|
||||
table.field_names = ["Number of occurences",field.upper()]
|
||||
for value in c:
|
||||
table.add_row([value[1],value[0].decode()])
|
||||
print (table)
|
Loading…
Reference in a new issue