Description\n-----------\n\nAfter the audit plugin has been installed and loaded, there will be some new global variables within MariaDB. These can be used to configure many components, limits, and methods related to auditing the server. You may set these variables related to the logs, such as their location, size limits, rotation parameters, and method of logging information. You may also set what information is logged, such connects, disconnects, and failed attempts to connect. You can also have the audit plugin log queries, read and write access to tables. So as not to overload your logs, the audit plugin can be configured based on lists of users. You can include or exclude the activities of specific users in the logs.\n\nTo see a list of audit plugin-related variables on the server and their values, execute the follow while connected to the server:\n\n``sql\nSHOW GLOBAL VARIABLES LIKE 'server_audit%';\n+-------------------------------+-----------------------+\n| Variable_name                 | Value                 |\n+-------------------------------+-----------------------+\n| server_audit_events           |                       |\n| server_audit_excl_users       |                       |\n| server_audit_file_buffer_size | 0                     |\n| server_audit_file_path        | server_audit.log      |\n| server_audit_file_rotate_now  | OFF                   |\n| server_audit_file_rotate_size | 1000000               |\n| server_audit_file_rotations   | 9                     |\n| server_audit_incl_users       |                       |\n| server_audit_logging          | OFF                   |\n| server_audit_mode             | 0                     |\n| server_audit_output_type      | file                  |\n| server_audit_query_log_limit  | 1024                  |\n| server_audit_sync_log_file    | OFF                   |\n| server_audit_syslog_facility  | LOG_USER              |\n| server_audit_syslog_ident     | mysql-server_auditing |\n| server_audit_syslog_info      |                       |\n| server_audit_syslog_priority  | LOG_INFO              |\n+-------------------------------+-----------------------+\n17 rows in set (0.003 sec)\n`\n\n`sql\nSHOW GLOBAL VARIABLES LIKE 'server_audit%';\n\n+-------------------------------+-----------------------+\n| Variable_name                 | Value                 |\n+-------------------------------+-----------------------+\n| server_audit_events           | CONNECT,QUERY,TABLE   |\n| server_audit_excl_users       |                       |\n| server_audit_file_path        | server_audit.log      |\n| server_audit_file_rotate_now  | OFF                   |\n| server_audit_file_rotate_size | 1000000               |\n| server_audit_file_rotations   | 9                     |\n| server_audit_incl_users       |                       |\n| server_audit_logging          | ON                    |\n| server_audit_mode             | 0                     |\n| server_audit_output_type      | file                  |\n| server_audit_query_log_limit  | 1024                  |\n| server_audit_syslog_facility  | LOG_USER              |\n| server_audit_syslog_ident     | mysql-server_auditing |\n| server_audit_syslog_info      |                       |\n| server_audit_syslog_priority  | LOG_INFO              |\n+-------------------------------+-----------------------+\n`\n\nThe values of these variables can be changed by an administrator with the SUPER privilege, using the SET statement. Below is an example of how to disable audit logging:\n\n`sql\nSET GLOBAL server_audit_logging=OFF;\n`\n\nAlthough it is possible to change all of the variables shown above, some of them may be reset when the server restarts. Therefore, you may want set them in the configuration file (e.g., /etc/my.cnf.d/server.cnf) to ensure the values are the same after a restart:\n\n`ini\n[server]\n... \nserver_audit_logging=OFF \n…\n`\n\nFor the reason given in the paragraph above, you would not generally set variables related to the auditing plugin using the SET statement. However, you might do so to test settings before making them more permanent. Since one cannot always restart the server, you would use the SET` statement to change immediately the variables and then include the same settings in the configuration file so that the variables are set again as you prefer when the server is restarted.\n\nConfiguring Logs and Setting Other Variables\n\nOf all of the server variables you can set, you may want to set initially the server_audit_events variable to tell the Audit Plugin which events to log. The Log Settings documentation page describes in detail the choices you have and provides examples of log entries related to them.\n\nYou can see a detailed list of system variables related to the MariaDB Audit Plugin on the System Variables documentation page. Status variables related to the Audit Plugin are listed and explained on the Status Variables documentation page.\n\nURL: https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-configuration