Skip to content

Instantly share code, notes, and snippets.

@dendisuhubdy
Created August 27, 2021 09:32
Show Gist options
  • Save dendisuhubdy/e3402b32ec2f7fe1cf93b9c464ecedb4 to your computer and use it in GitHub Desktop.
Save dendisuhubdy/e3402b32ec2f7fe1cf93b9c464ecedb4 to your computer and use it in GitHub Desktop.
parse_json_redpanda.py
import json
if __name__ == "__main__":
line_count = 0
with open("/Users/dendisuhubdy/Downloads/redpanda/data/2/kafka/btc_usdt_spot/0_111/0-1-v1.log", "rb") as fp:
Lines = fp.readlines()
for line in Lines:
print(line)
if line_count == 1:
break
# task is to parse multiple JSON messages in one line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment