# ColumnStore Audit Plugin

## Overview

MariaDB server includes an optional [Audit Plugin](/docs/server/reference/plugins/mariadb-audit-plugin.md) that enables logging and tracking of all user access and statements. It is included, but disabled by default. It can be enabled for ColumnStore.

## Installing the Audit Plugin

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

```sql
INSTALL PLUGIN server_audit 
SONAME 'server_audit.so';
```

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

```bash
$ 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](/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-installation.md)

## Enabling the Audit Plugin

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

```sql
SET GLOBAL server_audit_logging=ON;
```

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

```bash
$ 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:

```bash
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:

```bash
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](/docs/server/reference/plugins/mariadb-audit-plugin.md) documentation.

<sub>*This page is: Copyright © 2025 MariaDB. All rights reserved.*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/analytics/mariadb-columnstore/management/columnstore-system/columnstore-audit-plugin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
