W3cubDocs

/MariaDB

ColumnStore Audit Plugin

Introduction

MariaDB server includes an optional Audit Plugin that enables logging and tracking of all user access and statements. This is included and can be enabled for ColumnStore

Installation

To enable the audit plugin for the currently running instance (but no across restarts) run the following as mcsmysql with the default root account:

INSTALL PLUGIN server_audit 
SONAME 'server_audit.so';

To have this persist across restarts edit the ColumnStore my.cnf file (example shown for root install):

$ vi /usr/local/mariadb/columnstore/mysql/my.cnf
[mysqld]
... 
plugin_load=server_audit=server_audit.so 

For more details see the audit plugin installation guide

Enabling the audit plugin

To enable audit logging the following global variable must be set to ON:

SET GLOBAL server_audit_logging=ON;

To ensure this persists across restarts edit the ColumnStore my.cnf file (example shown for root install):

$ vi /usr/local/mariadb/columnstore/mysql/my.cnf
[server]
... 
server_audit_logging=ON

This will enable logging to the file /usr/local/mariadb/columnstore/mysql/db/server_audit.log. For example:

20170914 17:31:24,centos,root,localhost,11,114,QUERY,loans,'SELECT grade, AVG(loan_amnt) avg, FROM loanstats GROUP BY grade ORDER BY grade',0

To have the log entries written to syslog the global variable server_audit_output_type should be changed from 'file' to 'syslog'. In this case the 'syslog_info' entry contains the ColumnStore server instance name, for example:

Sep 14 17:46:51 centos mysql-server_auditing: columnstore-1 centos,root,localhost,11,117,QUERY,loans,'SELECT grade, AVG(loan_amnt) avg,FROM loanstats GROUP BY grade ORDER BY grade',0

For additional configuration and customization options see the Audit Plugin documentation.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/columnstore-audit-plugin/