I have mysql binlog enabled in row format. I am using mysqlbinlog to parse binlog file. I am using this command:
mysqlbinlog --base64-output=decode-rows -vv ./mysql-bin.000004
This command returns sql statements that I have to parse to generate json.
I used pymysqlreplication module in python but it doesn't read from binlog file. It requires real-time mysql replication connection. I can't access archived binlog files using master server.
Is there any way to parse archived binlog file and generate json?
You can use binlog-parser.
A tool for parsing a MySQL binlog file to JSON. Reads a binlog input file, queries a database for field names, writes JSON to stdout.
You can use
https://github.com/noplay/python-mysql-replication
This is used by several independent projects as mentioned on their page.
I have created a separate binlog parser based on sqlparse(python). The link to that :
https://github.com/monothorn/mysql-parser
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With