From 9291c346999338bb7b3a5307aec4f23d6006bcf4 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Fri, 10 Nov 2017 14:33:10 +0100 Subject: [PATCH] Added support of Discusison --- zmq_subscriber.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/zmq_subscriber.py b/zmq_subscriber.py index 1947d7c..35adc2e 100755 --- a/zmq_subscriber.py +++ b/zmq_subscriber.py @@ -178,6 +178,21 @@ def handler_keepalive(zmq_name, jsonevent): to_push = [ jsonevent['uptime'] ] publish_log(zmq_name, 'Keepalive', to_push) +def handler_conversation(zmq_name, jsonevent): + try: #only consider POST, not THREAD + jsonpost = jsonevent['Post'] + except KeyError: + return + print('sending' ,'Post') + org = jsonpost['org_name'] + categ = None + action = 'add' + handleContribution(zmq_name, org, + 'Discussion', + None, + action, + isLabeled=False) + def handler_object(zmq_name, jsondata): print('obj') return @@ -300,7 +315,7 @@ dico_action = { "misp_json_sighting": handler_sighting, "misp_json_organisation": handler_log, "misp_json_user": handler_log, - "misp_json_conversation": handler_log + "misp_json_conversation": handler_conversation }