I’d like to use a named pipe for the general log to track the frequency of queries with specific columns in the where clause (don’t you love technical debt?)
I’ve used…
to create the pipe and parse for the relevant strings, but attempting to enable the general log fails with the error : ERROR 1210 (HY000): Incorrect arguments to SET
Am I missing something or is it simply not possible to do this? I’m sure it used to work with earlier versions.
You can enable the general log to be stored in the mysql.general_log table instead of a log file. This allows you to query the general_log table using SELECT statements and apply a WHERE clause to retrieve specific details.
Hello @Andrew2,
The general log is typically not used for ongoing query analysis due to its impact on MySQL, especially when used in table style. Your two best options for query monitoring with minimal impact would be the slow log + long_query_time=0, or using the audit log plugin. With the slow log, you can set rate sampling to lower any impact (though you shouldn’t see impact unless you are > 20,000 qps), and the audit log lets you filter on specific users.