LP #1048844: pt-query-digest doesn't parse user info from general logs

Description

**Reported in Launchpad by Mike Siekkinen last update 17-09-2013 17:45:00

Running version 2.1.2.

The output of pt-query-digest --type=genlog does not include any user, host summary information.

The summary looks like

  1. Attribute pct total min max avg 95% stddev median

  2. ============ === ======= ======= ======= ======= ======= ======= =======

  3. Count 0 29

  4. Exec time 0 0 0 0 0 0 0 0

  5. Query size 0 5.04k 177 179 178 174.84 0 174.84

  6. String:

  7. Databases db1 (28/96%), db2 (1/3%)

  8. Query_time distribution

I realize not as much information is available as the slow query logs but the general log does include Connect lines. Taking a look at the script, the parse_event method seems to be looking for the Connect lines and storing the info per thread id.

Around line 9618

if ( $cmd eq 'Connect' ) {
if ( $arg =~ m/^Access denied/ ) {
$cmd = $arg;
}
else {
my ($user, undef, $db) = $arg =~ /(\S+)/g;
my $host;
($user, $host) = split(/@/, $user);
.....

I'd like to use this tool to get better insight into what specific accounts are accessing specific tables this this granularity isn't available from the information_schema statistics

Environment

None

Smart Checklist

Activity

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 3:56 PM
Updated December 21, 2019 at 2:32 PM