Created
June 21, 2023 09:58
-
-
Save maakuth/451f5802a9340fcb6cfb637169a6a554 to your computer and use it in GitHub Desktop.
Kcat timestamp parser
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
#!/usr/bin/env python3 | |
# Use with kcat -f "%p,%o,%T\n" to parse message timestamps | |
from sys import argv | |
from datetime import datetime | |
import csv | |
for row in csv.reader(open(argv[1], 'r'), delimiter=','): | |
print(f"Partition {row[0]} offset {row[1]}: {datetime.fromtimestamp(int(row[2])/1000)}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment