Audit log can't log 'db' information

Hi:
After install audit_log plugin,all work well but database information can’t log.
thanks for you help.

eg:
{“audit_record”:{“name”:“Query”,“record”:“4894_2023-06-08T06:38:10”,“timestamp”:“2023-06-08T07:04:53Z”,“command_class”:“update”,“connection_id”:“19”,“status”:0,“sqltext”:“update tt set c4=‘bb’ where c1=2”,“user”:“dba[dba] @ [192.168.1.10]”,“host”:“”,“os_user”:“”,“ip”:“192.168.1.10”,“db”:“”

Hi spihiker,

Could you please further explain what do you mean by “all work well but database information can’t log.” ?

I.e is the audit plugin not working at all? Is it not working for some stuff or under some cases?
By the way , make sure you are not using audit “Exclude” commands as shown in the official doc: Audit log plugin - Percona Server for MySQL . I.e:
audit_log_exclude_{account, command, database}. If using this filter then some of the information might not be audited

Hi CTutte,
Audit plugin can work well .but the value of “db” parameter in the audit log is always NULL.Please see the end of following log.

{“audit_record”:{“name”:“Query”,“record”:“4917_2023-06-08T06:38:10”,“timestamp”:“2023-06-08T09:17:24Z”,“command_class”:“delete”,“connection_id”:“27”,“status”:0,“sqltext”:“delete from user where uid=1”,“user”:“test[test] @ [192.168.1.10]”,“host”:“”,“os_user”:“”,“ip”:“192.168.1.10”,“db”:“”}}

Thank you .

Hi CTutte,
I know why. Connection problem.
I use mysql clinet to operate the database.When establishing a connection, add “–database” parameter,It’s ok.That’s all.
Thank you again.Have a nice weekend.