Created
May 11, 2016 14:18
-
-
Save lukasmartinelli/e0d89507234cbd30ec7253d7001cc05c to your computer and use it in GitHub Desktop.
Filter JSON lines jobs by unique id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
ids = {} | |
for line in open('failed-jobs.json'): | |
doc = json.loads(line) | |
if not doc['id'] in ids: | |
ids[doc['id']] = True | |
print(json.dumps(doc)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment