MySQL slow query log contains empty statements

866 views Asked by At

Percona server (mysql Ver 14.14 Distrib 5.5.40-36.1, for debian-linux-gnu (x86_64)) besides standart expected queries started logging following statements into slow query log. Statements get logged each second and come from percona agent. How can I get rid of these entries?

# Time: 141118 21:12:03
# User@Host: percona-agent[percona-agent] @ localhost []
# Thread_id: 13316  Schema:   Last_errno: 0  Killed: 0
# Query_time: 0.003071  Lock_time: 0.000116  Rows_sent: 376  Rows_examined: 376  Rows_affected: 0  Rows_read: 376
# Bytes_sent: 10902
SET timestamp=1416337923;
SHOW /*!50002 GLOBAL */ STATUS;
# Time: 141118 21:12:04
# User@Host: percona-agent[percona-agent] @ localhost []
# Thread_id: 13316  Schema:   Last_errno: 0  Killed: 0
# Query_time: 0.001624  Lock_time: 0.000083  Rows_sent: 376  Rows_examined: 376  Rows_affected: 0  Rows_read: 376
# Bytes_sent: 10899
SET timestamp=1416337924;
SHOW /*!50002 GLOBAL */ STATUS;

Slow query logging configuration follows:

laacz@zuze[mysql]> show global variables like '%slow%';
+------------------------------------+------------------------------------+
| Variable_name                      | Value                              |
+------------------------------------+------------------------------------+
| log_slow_admin_statements          | OFF                                |
| log_slow_filter                    | tmp_table_on_disk,filesort_on_disk |
| log_slow_queries                   | ON                                 |
| log_slow_rate_limit                | 1                                  |
| log_slow_rate_type                 | session                            |
| log_slow_slave_statements          | OFF                                |
| log_slow_sp_statements             | ON                                 |
| log_slow_verbosity                 |                                    |
| max_slowlog_files                  | 0                                  |
| max_slowlog_size                   | 134217728                          |
| slow_launch_time                   | 2                                  |
| slow_query_log                     | ON                                 |
| slow_query_log_always_write_time   | 10.000000                          |
| slow_query_log_file                | /var/log/mysql/mysql-slow.log      |
| slow_query_log_timestamp_always    | OFF                                |
| slow_query_log_timestamp_precision | second                             |
| slow_query_log_use_global_control  |                                    |
+------------------------------------+------------------------------------+
17 rows in set (0.00 sec)
1

There are 1 answers

0
Bill Karwin On

There's no filter in the Percona Server slow-log configuration variables that can prevent these statements from being logged.

But you could filter them out of an existing log by using pt-query-digest:

$ pt-query-digest --filter '$event->{user} !~ /percona-agent/' 
    --no-report --output slowlog mysql-slow.log