Closed mpchlets closed 8 years ago
Please link to the answer in the tutorial selection. :)
If you're OK with the answer being a Python script, I can submit a PR:
import sys
for line in sys.stdin:
if line.startswith("SET timestamp"):
timestamp = 1000 * 1000 * int(line.split("=")[1][:-2])
query = next(sys.stdin).strip()
print("{},{}".format(timestamp, query))
Usage is cat mysql-slowquery.log* | python3 convert.py
(assuming queries in the log are in order)
https://github.com/mpchlets/dbbench/blob/master/TUTORIAL.md