A bin folder, holding helpfull scripts and commands
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

log2json 385B

1234567891011121314151617
  1. #!/usr/bin/python3
  2. #
  3. import sys
  4. import json
  5. output = []
  6. with open(sys.argv[1], 'r') as rh:
  7. i = 1
  8. for line in rh.readlines():
  9. try:
  10. data = json.loads(line)
  11. except json.decoder.JSONDecodeError as e:
  12. print("ERROR in Line %d" % i)
  13. raise
  14. output.append(json.loads(line))
  15. i += 1
  16. print(json.dumps(output, indent=4))