Skip to content

Instantly share code, notes, and snippets.

@merlin-quix
Last active January 25, 2023 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merlin-quix/ee2015173fd320f521c914658d5785cf to your computer and use it in GitHub Desktop.
Save merlin-quix/ee2015173fd320f521c914658d5785cf to your computer and use it in GitHub Desktop.
for message in consumer:
mv = message.value
# Load the decoded value as JSON
mjson = json.loads(mv)
# Print the message key and a selection of data points from the JSON
print(f"KEY: {message.key} | "
f"VALUE: {datetime.utcfromtimestamp(mjson['time']/1e3)},
{mjson['host']},{mjson['address']} ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment