From 8c7e1c2e0c6faa608bf93867d9b409b4fd8b4f71 Mon Sep 17 00:00:00 2001 From: Ernst Widerberg Date: Thu, 4 Nov 2021 14:26:35 +0100 Subject: Update feeder for new data format and add asn_country_code --- tools/feeder.py | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) (limited to 'tools') diff --git a/tools/feeder.py b/tools/feeder.py index 224ec1b..cf52c36 100644 --- a/tools/feeder.py +++ b/tools/feeder.py @@ -8,24 +8,6 @@ import json import threading import time -data = { - "ip": "", - "port": 0, - "whois_description": "", - "asn": "", - "asn_country_code": "", - "ptr": "", - "abuse_mail": "", - "domain": "", - "timestamp_in_utc": "", - "producer_unique_keys": { - "subject_cn": "unknown", - "subject_o": "unknown", - "full_name": "", - "end_of_general_support": False, - } -} - def random_string(iters=1): full_string = '' @@ -143,16 +125,29 @@ def generate_blobs(nr_blobs=1): 'port': random_port(), 'whois_description': random_string(2), 'asn': random_asn(), + 'asn_country_code': random_country(), 'ptr': random_string(2), 'abuse_mail': random_email(), 'domain': "sunet.se", 'timestamp_in_utc': get_timestamp(), - 'producer_unique_keys': { - 'subject_cn': 'unknown', - 'subject_o': 'unknown', - 'full_name': random_string(3), - 'end_of_general_support': False, - } + 'user_presentation': { + 'description': 'A presentation of the observation as a whole (optional)', + 'data': { + random_string(): { + 'display_name': random_string(), + 'data': random_string(), + 'description': random_string(), + }, + random_string(): { + 'display_name': random_string(), + 'data': random_string(), + }, + random_string(): { + 'display_name': random_string(), + 'data': random_string(), + }, + } + }, }) return blobs -- cgit v1.1