Dear Friends,
Hope you are all doing well, like as of always, i need some help from you experts.
I am trying to create a filter in percona MySQL 8.4 to log only ddl and dml activities but somehow its logging all the events, kindly find the settings which are using
filter creation
SELECT audit_log_filter_set_filter(‘log’, ‘{
“filter”: {
“class”: [
{ “name”: [“connection”,“general”,“query”,“table_access”],
“event”:[“insert”,“update”, “delete”,“drop_db”,“create_db”,“alter_table”,“alter_user”,“drop_user”,“create_user”] }
]
}
}’
);
user assigning to filter
SELECT audit_log_filter_set_user(‘%’,‘log’);
mysql> select * from mysql.audit_log_filter;
±----------±-----±-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| filter_id | name | filter |
±----------±-----±-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1 | log | {“filter”: {“class”: [{“name”: [“connection”, “general”, “query”, “table_access”], “events”: [“insert”, “update”, “delete”, “drop_db”, “create_db”, “alter_table”, “alter_user”, “drop_user”, “create_user”]}]}} |
±----------±-----±-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
mysql>
mysql> select * from mysql.audit_log_user;
±---------±---------±-----------+
| username | userhost | filtername |
±---------±---------±-----------+
| % | % | log |
±---------±---------±-----------+
1 row in set (0.00 sec)
mysql> select @@version;
±----------+
| @@version |
±----------+
| 8.4.4-4 |
±----------+
1 row in set (0.00 sec)
log output
{
“timestamp”: “2025-05-14 10:16:15”,
“id”: 28,
“class”: “query”,
“event”: “query_status_end”,
“connection_id”: 11,
“query_data”: {
“query”: “select user,host from mysql.user”,
“status”: 0,
“sql_command”: “select”}
},
{
“timestamp”: “2025-05-14 10:16:15”,
“id”: 29,
“class”: “general”,
“event”: “result”,
“connection_id”: 11,
“account”: { “user”: “root[root] @ localhost ”, “host”: “localhost” },
“login”: { “user”: “root[root] @ localhost ”, “ip”: “”, “proxy”: “” },
“general_data”: { “status”: 0 }
},
Its still logging the all logs
Where i am going wrong