Percona Audit Plugin -
SET GLOBAL audit_log_rotate = ON; :
(if using syslog or custom paths):
/var/log/mysql/audit.log daily rotate 30 compress delaycompress postrotate mysql -e "SET GLOBAL audit_log_rotate = ON;" endscript percona audit plugin
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).
status: 1 = failure. "rule": "class": "table_access", "table": "payments", "command": ["DROP", "TRUNCATE", "DELETE", "UPDATE"], "log": true SET GLOBAL audit_log_rotate = ON; : (if using
(enable in logs):
"class": "table_access", "command": ["DROP", "ALTER", "TRUNCATE"], "log": true SET GLOBAL audit_log_rotate = ON
: Use ASYNCHRONOUS + separate fast disk (SSD) for audit log file. 9. Log Rotation & Management Manual rotation (closes current, reopens):
SET GLOBAL audit_log_rotate = ON; :
(if using syslog or custom paths):
/var/log/mysql/audit.log daily rotate 30 compress delaycompress postrotate mysql -e "SET GLOBAL audit_log_rotate = ON;" endscript
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).
status: 1 = failure. "rule": "class": "table_access", "table": "payments", "command": ["DROP", "TRUNCATE", "DELETE", "UPDATE"], "log": true
(enable in logs):
"class": "table_access", "command": ["DROP", "ALTER", "TRUNCATE"], "log": true
: Use ASYNCHRONOUS + separate fast disk (SSD) for audit log file. 9. Log Rotation & Management Manual rotation (closes current, reopens):