# Audit Plugin Status Variables

There are a few status variables related to the [MariaDB Audit Plugin](https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin), once it has been [installed](https://mariadb.com/docs/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-installation). These variables can be displayed using the [SHOW STATUS](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-status) statement like so:

```sql
SHOW STATUS LIKE 'server_audit%';

+----------------------------+------------------+
| Variable_name              | Value            |
+----------------------------+------------------+
| Server_audit_active        | ON               |
| Server_audit_current_log   | server_audit.log |
| Server_audit_last_error    |                  |
| Server_audit_writes_failed | 0                |
+----------------------------+------------------+
```

### Status Variables

Below is a list of all status variables related to the Audit Plugin. These cannot be set: These are not to be confused with system variables, which can be set. See [Server Status Variables](https://mariadb.com/docs/server/server-management/variables-and-modes/server-status-variables) for a complete list of status variables that can be viewed with the [SHOW STATUS](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-status) statement. See also the [Full list of MariaDB options, system and status variables](https://mariadb.com/docs/server/server-management/variables-and-modes/full-list-of-mariadb-options-system-and-status-variables).

#### `Server_audit_active`

* Description: If the auditing is actually working. It gets the ON value when the logging is successfully started. Then it can get the OFF value if the logging was stopped or log records can't be properly stored due to file or syslog errors.
* Data Type: `boolean`

#### `Server_audit_current_log`

* Description: The name of the logfile or the SYSLOG parameters that are in current use.
* Data Type: `string`

#### `Server_audit_last_error`

* Description: If something went wrong with the logging here you can see the message.
* Data Type: `string`

#### `Server_audit_writes_failed`

* Description: The number of log records since last logging-start that weren't properly stored because of errors of any kind. The global value can be flushed by [FLUSH STATUS](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/flush-commands).
* Data Type: `numeric`
* Default Value: `0`

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</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/server/reference/plugins/mariadb-audit-plugin/mariadb-audit-plugin-status-variables.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.
