Skip to content

Instantly share code, notes, and snippets.

@abg
Created June 9, 2017 14:26
Show Gist options
  • Save abg/89405ae9cfb1793524260bc316ff6ffc to your computer and use it in GitHub Desktop.
Save abg/89405ae9cfb1793524260bc316ff6ffc to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
## Chug github.com/cloudfoundry/lager logs
import json
import sys
import datetime
for line in sys.stdin:
try:
obj = json.loads(line)
except:
continue
dt = datetime.datetime.fromtimestamp(float(obj['timestamp']))
msg = obj['message']
print "%s\t%s" % (dt, msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment