pt-query-digest: table filtering
Registered by
Sheeri K. Cabral
I would love to be able to filter binlog and slow query log events by table. pt-query-digest already parses out table names (for the report section "Tables") so it should be possible to do this.
grep doesn't quite do the job because there's no defined # of lines in a binlog event (I haven't checked if slow query log is similar). I can make a kind of parser using awk (or more complex in perl), to indicate new events start at "# at POSITION", but that's a hack.
Something like the following command, to extract full events from only the tables named foo, bar or baz
pt-query-digest --tables foo,bar,baz mysql-bin.000001 --type=binlog
or
pt-query-digest –filter ‘($event->{table} || “”) =~ m/^foo$
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Sheeri K. Cabral
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
(?)