# Percona audit plugin and maximum length of system variable audit\_log\_exclude\_accounts

**URL:** <https://forums.percona.com/t/percona-audit-plugin-and-maximum-length-of-system-variable-audit-log-exclude-accounts/16907>\
**Category:** Percona Server for MySQL 5.7\
**Created:** [August 5, 2022, 9:51am UTC](https://forums.percona.com/t/percona-audit-plugin-and-maximum-length-of-system-variable-audit-log-exclude-accounts/16907 "2022-08-05T09:51:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![malmi](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@malmi](https://forums.percona.com/u/malmi)\
**Post date:** [August 5, 2022, 9:51am UTC](https://forums.percona.com/t/percona-audit-plugin-and-maximum-length-of-system-variable-audit-log-exclude-accounts/16907/1 "2022-08-05T09:51:30Z")

</div>

Hi,  
I’m using Percona-Server-server-57-5.7.33-36.1.el7.x86\_64  
and audit plugin is in the following version

```auto
mysql> SELECT * FROM information_schema.PLUGINS WHERE PLUGIN_NAME LIKE '%audit%'\G
***************************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.7
         PLUGIN_AUTHOR: Percona LLC and/or its affiliates.
    PLUGIN_DESCRIPTION: Audit log
        PLUGIN_LICENSE: GPL
           LOAD_OPTION: ON
1 row in set (0.02 sec)

```

I have around 20 application users and around 15 application servers where each application(user) may run and connect to a database. Thus the list is quite long.  
I don’t want to audit those users so I put the list in audit\_log\_exclude\_accounts in /etc/my.cnf file  
Unfortunately mysql server is not starting, the following error is raised

```auto
[ERROR] unknown option '--56.68.27 [and more users (subsequent entries in audit_log_exclude_accounts) listed afterwards]

```

What I was able to spot is that if line size with audit\_log\_exclude\_accounts (in /etc/my.cnf) is up to 4094 characters, the server starts properly.

Are there any limitations on audit\_log\_exclude\_accounts maximum length?  
Maybe it’s a general mysql system variable limitation?  
Anyone had such an issue?

Regards,  
Michał

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 5, 2022, 3:34pm UTC](https://forums.percona.com/t/percona-audit-plugin-and-maximum-length-of-system-variable-audit-log-exclude-accounts/16907/2 "2022-08-05T15:34:28Z")

</div>

Can you do the inverse?

`audit_log_include_accounts: The accounts to include in audit logging. If this variable is set, only these accounts are audited.`

---

<div class="post-metadata">

**Author:** ![malmi](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@malmi](https://forums.percona.com/u/malmi)\
**Post date:** [August 6, 2022, 5:37am UTC](https://forums.percona.com/t/percona-audit-plugin-and-maximum-length-of-system-variable-audit-log-exclude-accounts/16907/3 "2022-08-06T05:37:45Z")

</div>

I know this option but it would cause other difficulties: each time new employee joins a company, an administrator must remember to add his/her account to auditing.  
From security point of view this is error prone and I don’t want to use it.  
I prefer to find a solution (or at least understand) why there is a limit on the variable length.

Regards,  
Michał

---

<div class="post-metadata">

**Author:** ![malmi](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@malmi](https://forums.percona.com/u/malmi)\
**Post date:** [August 9, 2022, 11:33am UTC](https://forums.percona.com/t/percona-audit-plugin-and-maximum-length-of-system-variable-audit-log-exclude-accounts/16907/4 "2022-08-09T11:33:26Z")

</div>

It looks like it’s rather a general issue: if there is a line more than 4094 characters long, the server won’t start.  
You can try add the following as a comment (use # at the beginning)

```auto
tr -dc A-Za-z0-9 </dev/urandom | head -c 4093 ; echo 'This will cause overflow'

```

and when starting mysql you will receive

```auto
[ERROR] unknown option '--This will cause overflow'

```

Any ideas how to solve it?  
Can someone help me identify entry point for reading my.cnf configuration file in the source code?

Regards,  
Michał
