mirror of https://github.com/MISP/PyMISP
parent
85b9c92313
commit
4e50f58a74
|
@ -22,7 +22,7 @@ def init():
|
||||||
|
|
||||||
def saveEvent(event):
|
def saveEvent(event):
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(outputdir, f'{event["uuid"]}.json'), 'w') as f:
|
with open(os.path.join(outputdir, f'{event["Event"]["uuid"]}.json'), 'w') as f:
|
||||||
json.dump(event, f, indent=2)
|
json.dump(event, f, indent=2)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
@ -68,9 +68,8 @@ if __name__ == '__main__':
|
||||||
if not e_feed:
|
if not e_feed:
|
||||||
print(f'Invalid distribution {e.distribution}, skipping')
|
print(f'Invalid distribution {e.distribution}, skipping')
|
||||||
continue
|
continue
|
||||||
if '_hashes' in e_feed:
|
hashes += [[h, e.uuid] for h in e_feed['Event'].pop('_hashes')]
|
||||||
hashes += [[h, e.uuid] for h in e_feed.pop('_hashes')]
|
manifest.update(e_feed['Event'].pop('_manifest'))
|
||||||
manifest.update(e_feed.pop('_manifest'))
|
|
||||||
saveEvent(e_feed)
|
saveEvent(e_feed)
|
||||||
print("Event " + str(counter) + "/" + str(total) + " exported.")
|
print("Event " + str(counter) + "/" + str(total) + " exported.")
|
||||||
counter += 1
|
counter += 1
|
||||||
|
|
Loading…
Reference in New Issue