PyMISP/examples/stats.py

17 lines
522 B
Python
Raw Normal View History

2016-04-28 14:44:01 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
2019-07-17 16:46:47 +02:00
from pymisp import ExpandedPyMISP
2016-04-28 14:44:01 +02:00
from keys import misp_url, misp_key, misp_verifycert
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Output attributes statistics from a MISP instance.')
args = parser.parse_args()
2019-07-17 16:46:47 +02:00
misp = ExpandedPyMISP(misp_url, misp_key, misp_verifycert)
2016-04-28 14:44:01 +02:00
2019-07-17 16:46:47 +02:00
print(misp.get_attributes_statistics(misp, percentage=True))
print(misp.get_attributes_statistics(context='category', percentage=True))