Skip to content

Commit

Permalink
Fix AWS integration:
Browse files Browse the repository at this point in the history
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 b21dcf7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/amazon/getawslog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit b21dcf7

Please sign in to comment.