Hi, first post and im hoping a relatively straight forward fix.
Im currently trying to use the audit log plugin across 3 servers and have this information feed to a kibana dashboard which has been successful on 2/3 servers. All these servers as are setup the same as they are used for replication so there shouldn’t be any glaringly obvious reason that it shouldn’t work.
A bit more background is that our logrotate config that is setup on these servers, runs at 6am every morning and the logging works just fine up until that point. After logrotate runs, audit.log no longer is being logged too until MySQL is restarted (This needs to be done manually).
I have tried all manner of permissions and settings but for some reason there is just something about MySQL not being restarted that is causing it to have an issue but i cant seem to find out what it is.
At first i thought this may be something with logrotate and the audit_log_rotations functionality that is built into the plugin conflicting with each other but this will surely affect functionality across the remaining servers?
Below are the current settings that i have for audit.log and our current logrotate config.
| audit_log_file | /var/log/mysql/audit.log |
| audit_log_flush | OFF |
| audit_log_format | JSON |
| audit_log_handler | FILE |
| audit_log_include_accounts | |
| audit_log_include_commands | |
| audit_log_include_databases | |
| audit_log_policy | ALL |
| audit_log_rotate_on_size | 20480 |
| audit_log_rotations | 2 |
| audit_log_strategy | ASYNCHRONOUS |
| audit_log_syslog_facility | LOG_USER |
| audit_log_syslog_ident | percona-audit |
| audit_log_syslog_priority | LOG_INFO
/var/log/mysql/*log {
daily
rotate 7
missingok
create 640 mysql adm
compress
postrotate
# run if mysqld is running
if test -n "`ps acx|grep mysqld`"; then
/usr/bin/mysqladmin flush-logs
fi
endscript
}
Am i simply missing something that is causing this to stop working? As far as i observe, lograte is rotating audit.log and calling it audit.log.1.gz and peronca is coming in and creating a new audit.log file but it just isn’t passing any information to it until MySQL is restarted.
Any help or information would be perfect!