Audit Plugin: Percona
SHOW STATUS LIKE 'audit_log%'; -- e.g., audit_log_current_size, audit_log_buffer_size, audit_log_lost_events (critical):
Apply filter:
(enable in logs):
"class": "table_access", "command": ["DROP", "ALTER", "TRUNCATE"], "log": true
SET GLOBAL audit_log_filter = ' ... json ... '; "audit_record": "timestamp": "2025-02-18T10:23:45.123 UTC", "id": 202502, "class": "general", "event": "status", "connection_id": 54321, "user": "webapp@10.0.1.55", "host": "10.0.1.55", "database": "ecommerce", "command": "Query", "sqltext": "UPDATE orders SET status='shipped' WHERE order_id=12345", "status": 0, "rows_examined": 1, "rows_sent": 0 percona audit plugin
[mysqld] audit_log_rotate_on_size = 104857600 audit_log_rotations = 9 Old files: audit.log.1 , audit.log.2 , ...
SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'audit_log_lost_events'; If > 0, increase audit_log_buffer_size (default 1MB → set to 4–8MB). SHOW STATUS LIKE 'audit_log%'; -- e
SET GLOBAL audit_log_rotate = ON; :