Audit Log Filter Doesn't accept user@%

I am running the audit_log_filter component with MySQL 8.4.8 (Oracle MySQL).

If I run:

SELECT audit_log_filter_set_user(‘%’, ‘log_connections_and_queries’);

it works fine.

If I run:

SELECT audit_log_filter_set_user(‘user@localhost’, ‘log_connections_and_queries’);

it works fine.

But if I try and run:

SELECT audit_log_filter_set_user(‘user@%’, ‘log_connections_and_queries’);

I get:

Error Code: 1123. Can’t initialize function ‘audit_log_filter_set_user’; Wrong argument: bad host name format

Is there a way to add “user@%”.

I tried removing all other user entries first, using a different filter name. But it seems that it simply doesn’t like “user@%”

Try your command like this:

SELECT audit_log_filter_set_user('user@%', 'log_connections_and_queries');

Notice I changed from the ‘ ’ (smart quotes) to ’ '.

Still the same. I also tried “ “. No difference.

Are you running MySQL Community or Oracle MySQL Enterprise?

MySQL Community Edition

What is the output from this:

SELECT @@version, @@version_comment;
8.4.8 MySQL Community Server - GPL

I just tried this on a test server, withe the same OS and MySQL version, and of course, it works fine on there. So it seems there is something about my setup it doesn’t like.

Old versions of the audit log filter component had a bug like this - PS-9024

It looks like I had installed an older version of the component by mistake. I copied the working one across and installed that, and it now seems to be fine.