subtitle: How to use awk to filter binlogs for specific tables
The task: Find out how many inserts were done to a set of tables over a period of time. Specifically avg inserts/min, avg inserts/hour, avg inserts/day, for the past week. Seems simple, right?
I was surprised that there was no good way to get what was done to a specific table, for data gathering AND forensic purposes!
These tables are be deleted from, so just using rows and timestamps is not valid. We have binary logs, which log when an insert was done. My first thought was to use pt-query-digest, since the tool has a “Tables” section in the output, so it already parses out which tables are in a query.
Sadly, tables is not an attribute I can --filter on,
at least not in my version of pt-query-digest. (insert sad
trombone here)