patternMinor
MariaDB audit plugin logs all queries instead of DML only
Viewed 0 times
logsallauditinsteadplugindmlqueriesonlymariadb
Problem
I was testing the "server_audit" plugin of MariaDB, which I configured like this:
and I am currently running
Based on the docs, the value
Same as QUERY, but filters only DML-type queries (DO, CALL, LOAD DATA/XML, DELETE, INSERT, UPDATE, HANDLER and REPLACE statements)
emphasis mine.
After restarting the server, the log files has correctly been created, however it is logging also other queries, like for example plain
Is my configuration somewhat incorrect, or is it perhaps an error on MariaDB side?
plugin-load-add = server_audit
server_audit_logging = ON
server_audit_events = QUERY_DML
server_audit_output_type = FILE
server_audit_file_path = /path/to/audit.log
server_audit_query_log_limit = 1048576
server_audit_file_rotate_size = 1073741824
server_audit_file_rotations = 1and I am currently running
MariaDB 10.1.29 with MariaDB Audit Plugin version 1.4.3.Based on the docs, the value
QUERY_DML should beSame as QUERY, but filters only DML-type queries (DO, CALL, LOAD DATA/XML, DELETE, INSERT, UPDATE, HANDLER and REPLACE statements)
emphasis mine.
After restarting the server, the log files has correctly been created, however it is logging also other queries, like for example plain
SELECTs.Is my configuration somewhat incorrect, or is it perhaps an error on MariaDB side?
Solution
As of version 1.4.4 of the plugin, there is now a
Same as QUERY_DML, but doesn't log SELECT queries. (since version 1.4.4) (DO, CALL, LOAD DATA/XML, DELETE, INSERT, UPDATE, HANDLER and REPLACE statements)
This was introduced in MariaDB 5.5.42, MariaDB 10.0.17, and MariaDB 10.1.4.
QUERY_DML_NO_SELECT type that should give you what you are expecting.Same as QUERY_DML, but doesn't log SELECT queries. (since version 1.4.4) (DO, CALL, LOAD DATA/XML, DELETE, INSERT, UPDATE, HANDLER and REPLACE statements)
This was introduced in MariaDB 5.5.42, MariaDB 10.0.17, and MariaDB 10.1.4.
Context
StackExchange Database Administrators Q#199221, answer score: 3
Revisions (0)
No revisions yet.