Permalink
Browse files

Fix AWS integration:

Discard null fields from json output
Add source log file to json output
  • Loading branch information...
chemamartinez committed Nov 29, 2017
1 parent 348e48c commit b21dcf7768a6d33d91cf2b9c3eee30b09a41b7c6
Showing with 7 additions and 2 deletions.
  1. +7 −2 tools/amazon/getawslog.py
@@ -112,8 +112,13 @@ def main(argv):
j = json.load(data)
if "Records" not in j:
continue
for item in j["Records"]:
aws_log = {'aws': item}
for json_event in j["Records"]:
new_dict = {}
for key in json_event:
if json_event[key]:
new_dict[key] = json_event[key]
new_dict['log_file'] = newFile
aws_log = {'aws': new_dict}
log.write("{0}\n".format(json.dumps(aws_log)))
log.close()

0 comments on commit b21dcf7

Please sign in to comment.