# Percona MYSQL 8.0.36 audit log compression and encryption

**URL:** <https://forums.percona.com/t/percona-mysql-8-0-36-audit-log-compression-and-encryption/35974>\
**Category:** MySQL & MariaDB\
**Tags:** mysql, percona\
**Created:** [January 6, 2025, 5:41am UTC](https://forums.percona.com/t/percona-mysql-8-0-36-audit-log-compression-and-encryption/35974 "2025-01-06T05:41:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_chen](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jason_chen/32/19686_2.png) [@jason\_chen](https://forums.percona.com/u/jason_chen)\
**Post date:** [January 6, 2025, 5:41am UTC](https://forums.percona.com/t/percona-mysql-8-0-36-audit-log-compression-and-encryption/35974/1 "2025-01-06T05:41:16Z")

</div>

HI Guys,

am trying to perform the compression and encryption on percona mysql 8.0.36.

refer to : [Audit Log Filter compression and encryption - Percona Server for MySQL](https://docs.percona.com/percona-server/8.0/audit-log-filter-compression-encryption.html#compression)

## Compression

You can enable compression for any [format] by setting the `audit_log_filter_compression` system variable when the server starts.

The `audit_log_filter_compression` variable can be either of the following:

- NONE (no compression) - the default value
- GZIP - uses the GNU Zip compression

## Encryption[¶]

You can encrypt any audit log filter file in any [format] The audit log filter plugin generates the initial password, but you can use user-defined passwords after that. The plugin stores the passwords in the keyring, so that feature must be enabled.

Set the `audit_log_filter_encryption` system variable with the server starts. The allowed values are the following:

- NONE - no encryption, the default value
- AES - AES-256-CBC (Cipher Block Chaining) encryption

But can’t find out related variables on instance:

## root@localhost:mysql\_jasonDB.sock [performance\_schema]\> select @@audit\_log\_filter\_compression;

## select @@audit\_log\_filter\_compression

## ERROR 1193 (HY000): Unknown system variable ‘audit\_log\_filter\_compression’ root@localhost:mysql\_jasonDB.sock [performance\_schema]\> select @@audit\_log\_filter\_encryption;

## select @@audit\_log\_filter\_encryption

## ERROR 1193 (HY000): Unknown system variable ‘audit\_log\_filter\_encryption’ root@localhost:mysql\_jasonDB.sock [performance\_schema]\> select audit\_log\_encryption\_password\_get();

## select audit\_log\_encryption\_password\_get()

ERROR 1305 (42000): FUNCTION performance\_schema.audit\_log\_encryption\_password\_get does not exist

Is there a guide to enable them on audit log?

Thanks  
Jason

---

<div class="post-metadata">

**Author:** ![CTutte](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ctutte/32/1341_2.png) [@CTutte](https://forums.percona.com/u/CTutte)\
**Post date:** [January 6, 2025, 12:45pm UTC](https://forums.percona.com/t/percona-mysql-8-0-36-audit-log-compression-and-encryption/35974/2 "2025-01-06T12:45:09Z")

</div>

Hi jason\_chen,

Have you already installed the audit plugin? If not you can do so folllowing the instructions from:

> **[Percona Server for MySQL - Audit log plugin](https://docs.percona.com/percona-server/8.0/audit-log-plugin.html)**
>
> Percona Audit Log Plugin provides monitoring and logging of connection and query
> activity that were performed on specific server. Information about the activity
> is stored in a log file. This
> implementation is alternative to the MySQL Enterprise Audit...

If after installing the audit plugin you still cannot find the above mentioned variables then please provide:  
SELECT \* FROM information\_schema.PLUGINS WHERE PLUGIN\_NAME LIKE ‘%audit%’;  
SHOW variables LIKE ‘audit%’;

Regards

---

<div class="post-metadata">

**Author:** ![jason\_chen](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jason_chen/32/19686_2.png) [@jason\_chen](https://forums.percona.com/u/jason_chen)\
**Post date:** [January 7, 2025, 2:31am UTC](https://forums.percona.com/t/percona-mysql-8-0-36-audit-log-compression-and-encryption/35974/3 "2025-01-07T02:31:11Z")

</div>

Hi C Tutte,

Thanks for your quick reply!

Here is my results:

## root@localhost:mysql\_jasonDB.sock [performance\_schema]\> select @@version;

## select @@version

±----------+  
| @@version |  
±----------+  
| 8.0.36-28 |  
±----------+  
1 row in set (0.00 sec)

## root@localhost:mysql\_jasonDB.sock [performance\_schema]\> SELECT \* FROM information\_schema.PLUGINS WHERE PLUGIN\_NAME LIKE ‘%audit%’;

## SELECT \* FROM information\_schema.PLUGINS WHERE PLUGIN\_NAME LIKE ‘%audit%’

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
PLUGIN\_NAME: audit\_log  
PLUGIN\_VERSION: 0.2  
PLUGIN\_STATUS: ACTIVE  
PLUGIN\_TYPE: AUDIT  
PLUGIN\_TYPE\_VERSION: 4.1  
PLUGIN\_LIBRARY: audit\_log.so  
PLUGIN\_LIBRARY\_VERSION: 1.11  
PLUGIN\_AUTHOR: Percona LLC and/or its affiliates.  
PLUGIN\_DESCRIPTION: Audit log  
PLUGIN\_LICENSE: GPL  
LOAD\_OPTION: ON  
1 row in set (0.00 sec)

## root@localhost:mysql\_jasonDB.sock [performance\_schema]\> SHOW variables LIKE ‘audit%’;

## SHOW variables LIKE ‘audit%’

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_buffer\_size  
Value: 1048576  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 2. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_exclude\_accounts  
Value: [proxy\_monitor@10.29.234.18](mailto:proxy_monitor@10.29.234.18),proxy\_monitor@10.29.234.19,proxy\_monitor@10.29.234.20,mgr\_repl\_user@10.29.234.18,mgr\_repl\_user@10.29.234.19,mgr\_repl\_user@10.29.234.20  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 3. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_exclude\_commands  
Value:  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 4. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_exclude\_databases  
Value:  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 5. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_file  
Value: /data/jasonDB/audit/audit.log  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 6. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_flush  
Value: OFF  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 7. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_format  
Value: JSON  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 8. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_handler  
Value: FILE  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 9. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_include\_accounts  
Value:  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 10. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_include\_commands  
Value:  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 11. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_include\_databases  
Value:  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 12. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_policy  
Value: ALL  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 13. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_rotate\_on\_size  
Value: 209715200  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 14. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_rotations  
Value: 200  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 15. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_strategy  
Value: ASYNCHRONOUS  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 16. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_syslog\_facility  
Value: LOG\_USER  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 17. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_syslog\_ident  
Value: percona-audit  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 18. row \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Variable\_name: audit\_log\_syslog\_priority  
Value: LOG\_INFO  
18 rows in set (0.01 sec)

---

<div class="post-metadata">

**Author:** ![jason\_chen](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jason_chen/32/19686_2.png) [@jason\_chen](https://forums.percona.com/u/jason_chen)\
**Post date:** [January 7, 2025, 7:53am UTC](https://forums.percona.com/t/percona-mysql-8-0-36-audit-log-compression-and-encryption/35974/4 "2025-01-07T07:53:15Z")

</div>

@CTutte Is that related to the PLUGIN\_LIBRARY\_VERSION ?

official doc writes: PLUGIN\_LIBRARY\_VERSION: 1.7  
My env is: PLUGIN\_LIBRARY\_VERSION: 1.11

---

<div class="post-metadata">

**Author:** ![CTutte](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ctutte/32/1341_2.png) [@CTutte](https://forums.percona.com/u/CTutte)\
**Post date:** [January 9, 2025, 12:23pm UTC](https://forums.percona.com/t/percona-mysql-8-0-36-audit-log-compression-and-encryption/35974/5 "2025-01-09T12:23:17Z")

</div>

Hi again!

I was told that you are missing the audit log filter plugin:

> **[Percona Server for MySQL - Install the Audit Log Filter](https://docs.percona.com/percona-server/8.0/install-audit-log-filter.html)**
>
> The plugin\_dir system variable defines the plugin library location. If needed, at server startup, set the plugin\_dir variable.

Try installing that one and let us know if it works!

---

<div class="post-metadata">

**Author:** ![pbirch](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/pbirch/32/2865_2.png) [@pbirch](https://forums.percona.com/u/pbirch)\
**Post date:** [January 9, 2025, 1:19pm UTC](https://forums.percona.com/t/percona-mysql-8-0-36-audit-log-compression-and-encryption/35974/6 "2025-01-09T13:19:07Z")

</div>

I would recommend uninstalling the audit log plugin before installing the audit log filter plugin.

---

<div class="post-metadata">

**Author:** ![jason\_chen](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jason_chen/32/19686_2.png) [@jason\_chen](https://forums.percona.com/u/jason_chen)\
**Post date:** [January 15, 2025, 9:13am UTC](https://forums.percona.com/t/percona-mysql-8-0-36-audit-log-compression-and-encryption/35974/7 "2025-01-15T09:13:12Z")

</div>

@pbirch @CTutte

Hello guys,

Sorry for response late!

Seems it works on mysql side. Thank you very much!

Installed the Audit Log Filter as below steps:

1.Create a audit database to store the JSON audit table

```
create database db_audit;

```

2.install the script: audit\_log\_filter\_linux\_install.sql  
Find script:  
INFRA [mysql@dc02psqldbuat04 share]# pwd  
/data/percona8.0.36/share  
INFRA [mysql@dc02psqldbuat04 share]# ls -l | grep audit\_log\_filter\_linux\_install.sql  
-rw------- 1 mysql mysql 2316 Dec 21 15:35 audit\_log\_filter\_linux\_install.sql  
Run script:  
/data/percona8.0.35/bin/mysql --login-path=rootjasonDB -D db\_audit \< /data/percona8.0.36/share/audit\_log\_filter\_linux\_install.sql

3.Verify plugin related to audit filter:

root@localhost:mysql\_jasonDB.sock [(none)]\> SELECT PLUGIN\_NAME, PLUGIN\_STATUS FROM INFORMATION\_SCHEMA.PLUGINS WHERE PLUGIN\_NAME LIKE ‘audit%’;  
±-----------------±--------------+  
| PLUGIN\_NAME | PLUGIN\_STATUS |  
±-----------------±--------------+  
| audit\_log | ACTIVE |  
| audit\_log\_filter | ACTIVE |  
±-----------------±--------------+  
2 rows in set (0.00 sec)

4.Verify vaiables related to audit filter:

root@localhost:mysql\_jasonDB.sock [(none)]\> select @@audit\_log\_filter\_compression;  
±-------------------------------+  
| @@audit\_log\_filter\_compression |  
±-------------------------------+  
| NONE |  
±-------------------------------+  
1 row in set (0.00 sec)

root@localhost:mysql\_jasonDB.sock [(none)]\> select @@audit\_log\_filter\_encryption;  
±------------------------------+  
| @@audit\_log\_filter\_encryption |  
±------------------------------+  
| AES |  
±------------------------------+  
1 row in set (0.00 sec)

Thanks  
Jason
