DML
, GTID
, XID
, and QUERY
events, which represent modification to data rows, start of transactions, commit of transactions, and DDL
statements, respectively. DML events include insert
, update
, and delete
events.DML
event is as follows:{"logtype":"mysqlbinlog", // Log type. The value is unique and must be `mysqlbinlog`"eventtype":23, // Event type code of a binlog in MySQL"eventtypestr":"insert", / *Event type string. The value can be `insert`, `update`, `delete`, `gtid`, `xid`, or `query`.An `insert`, `update`, or `delete` event indicates `DML` statements; a `tid` event indicates start of a transaction;An `xid` event indicates end of a transaction; a `query` event indicates `DDL` statements */"db":"testdb", // Database name"table":"testtable", // Table name"localip":"000.00.000.000", // IP of the server where the instance is located"localport":0000, // Instance port"begintime":1511350073, // Start time of the transaction to which the current event belongs"gtid":"0-2670193178-726233561", // `GTID` of the transaction to which the current event belongs"event_index":"4", // Number of the event in the transaction"where":[ // `where` field, which indicates the value of each field before the row is modified],"field":[ // `field` field, which indicates the value of each field after the row is modified"1","'name1'"]}
GTID
event is as follows:{ // A `GTID` event represents the start of a transaction"logtype":"mysqlbinlog","eventtype":33,"eventtypestr":"gtid","db":"sysdb","table":"statustableforhb","localip":"10.231.23.241","localport":8810,"begintime":1511419963,"gtid":"35be190b-d019-11e7-ab7a-a0423f32c225:469","event_index":"1"}
XID
event is as follows:{ // An `XID` event represents that a transaction has been committed"logtype":"mysqlbinlog","eventtype":16,"eventtypestr":"xid","db":"testsummer","table":"test_table1","localip":"10.231.23.241","localport":8810,"begintime":1511419963,"gtid":"35be190b-d019-11e7-ab7a-a0423f32c225:469","event_index":"5","xid":"11866"}
QUERY
event is as follows:{"logtype":"mysqlbinlog","eventtype":2,"eventtypestr":"query", // `DDL` statement of a `QUERY` event"db":"testsummer","table":"statustableforhb","localip":"10.231.23.241","localport":8810,"begintime":1511419941,"gtid":"35be190b-d019-11e7-ab7a-a0423f32c225:452","event_index":"2","sql":"create table test_table1 (id int primary key,name varchar(20))"}
Was this page helpful?