Home

Awesome

boxercrab

MySQL binlog parser impl with Rust

Rust BoxerCrab Code Coverage

Boxercrab tried to parse every field in binlog, but for the reasons of documentation, ability, etc., some fields could not be parsed yet.

Parsed events matrix:

HexEvent NameParsedNote
0x01START_EVENT_V3Ntoo old to support
0x02QUERY_EVENTY
0x03STOP_EVENTY
0x04ROTATE_EVENTY
0x05INTVAR_EVENTY
0x06LOAD_EVENTYnot tested
0x07SLAVE_EVENTYnot tested
0x08CREATE_FILE_EVENTYnot tested
0x09APPEND_BLOCK_EVENTYnot tested
0x0aEXEC_LOAD_EVENTY
0x0bDELETE_FILE_EVENTYnot tested
0x0cNEW_LOAD_EVENTYnot tested
0x0dRAND_EVENTY
0x0eUSER_VAR_EVENTYnot fully tested
0x0fFORMAT_DESCRIPTION_EVENTY
0x10XID_EVENTY
0x11BEGIN_LOAD_QUERY_EVENTY
0x12EXECUTE_LOAD_QUERY_EVENTY
0x13TABLE_MAP_EVENTYnot fully tested
0x14WRITE_ROWS_EVENTv0N
0x15UPDATE_ROWS_EVENTv0N
0x16DELETE_ROWS_EVENTv0N
0x17WRITE_ROWS_EVENTv1N
0x18UPDATE_ROWS_EVENTv1N
0x19DELETE_ROWS_EVENTv1N
0x1aINCIDENT_EVENTYnot tested
0x1bHEARTBEAT_EVENTYnot tested
0x1cIGNORABLE_EVENTN
0x1dROWS_QUERY_EVENTY
0x1eWRITE_ROWS_EVENTv2Ynot fully tested
0x1fUPDATE_ROWS_EVENTv2Ynot fully tested
0x20DELETE_ROWS_EVENTv2Ynot fully tested
0x21GTID_EVENTY
0x22ANONYMOUS_GTID_EVENTY
0x23PREVIOUS_GTIDS_EVENTY

Of course, I can't guarantee that the all fields have been parsed correctly. If you encounter an error, please contact me. It is best to attach the binlog file.

usage

cli

install cli tool

cargo install --bin bcrab --git https://github.com/PrivateRookie/boxercrab.git

all commands

MySQL binlog tool impl with Rust

USAGE:
    bcrab [FLAGS] <SUBCOMMAND>

FLAGS:
    -d, --debug      enable debug info
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    desc     Show bin log desc msg
    help     Prints this message or the help of the given subcommand(s)
    trans    Transform a binlog file to specified format

trans

this sub command transform binlog to json or yaml file

bcrab-trans 0.2.0
Transform a binlog file to specified format

USAGE:
    bcrab trans [OPTIONS] <input> [output]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f, --format <format>    Output format [default: Json]  [possible values: Json, Yaml]

ARGS:
    <input>     Binlog file path
    <output>    Output file path, if not present, print to stdout

desc

show desc info for a binlog

bcrab-desc 0.2.0
show bin log desc msg

USAGE:
    bcrab desc <input>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <input>    binlog file path

lib

boxercrab can be use as a library too, but doc is not ready yeah, it's in planning.