From 51f49ddcaaa080ce4bff1fcb676beceed5dd456f Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 6 Apr 2017 14:20:00 +0200 Subject: [PATCH 1/2] Updated last.py to dump json results straight away Output was not usable with cli utilities such as: ```cat results.json | python -m simplejson.tool```. It's now usable and works perfectly. --- examples/last.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/last.py b/examples/last.py index 75f8162..4af048c 100755 --- a/examples/last.py +++ b/examples/last.py @@ -26,9 +26,7 @@ def download_last(m, last, out=None): exit(0) else: with open(out, 'w') as f: - for e in result['response']: - f.write(json.dumps(e) + '\n') - + f.write(json.dumps(result['response'])) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Download latest events from a MISP instance.') From dd3ce6c758377671323a17551b9c9c7080de5fb7 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 6 Apr 2017 14:23:04 +0200 Subject: [PATCH 2/2] Update last.py --- examples/last.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/last.py b/examples/last.py index 4af048c..f7e5773 100755 --- a/examples/last.py +++ b/examples/last.py @@ -26,7 +26,7 @@ def download_last(m, last, out=None): exit(0) else: with open(out, 'w') as f: - f.write(json.dumps(result['response'])) + f.write(json.dumps(result['response'])) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Download latest events from a MISP instance.')