Pt-query-digest table filtering

Hi.
I use pt-query-digest to analyze mysql slow query log.When the following parameters are added:
–filter ‘($event->{table} || “”) =~ m/^tab_a$/i’ ,can’t work well.
How to filter table? Thanks.

Hello @spihiker, just to confirm, you want to filter a table named tab_a and only see those queries? Have you confirmed by looking in the slow log itself (ie: grep) that there are queries accessing this table?

Hello @matthewb.
1.Yes.Just filter a table named tab_a and see the table queries.
2.I was sure there are quereies accessing this table.
3.The same goes for mysql general log.

If i don’t add: –filter ‘($event->{table} || “”) =~ m/^tab_a$/i’ . I can see the statistics of this table in the report。Is the expression(ie:($event->{table} || “”)) not supported?

pt-query-digest version:3.5.5
Command as following:
     pt-query-digest --filter '($event->{table} || "") =~ m/^tab_a$/i' slowquery.log
     pt-query-digest --type genlog --filter '($event->{table} || "") =~ m/^tab_a$/i' mydb01-gen.log

 Thanks for you help.

@spihiker Did you read over the documentation? I don’t see $event->{table} as a valid filter list in the docs: pt-query-digest — Percona Toolkit Documentation

You can filter on fingerprint or arg to pattern match a specific table.

1 Like

Thank you very much.