# Named pipe for general log

**URL:** <https://forums.percona.com/t/named-pipe-for-general-log/35463>\
**Category:** Percona Server for MySQL 8.0\
**Created:** [December 4, 2024, 11:02am UTC](https://forums.percona.com/t/named-pipe-for-general-log/35463 "2024-12-04T11:02:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew2](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/andrew2/32/4044_2.png) [@Andrew2](https://forums.percona.com/u/Andrew2)\
**Post date:** [December 4, 2024, 11:02am UTC](https://forums.percona.com/t/named-pipe-for-general-log/35463/1 "2024-12-04T11:02:39Z")

</div>

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…

mkfifo [general.log]  
chmod mysql:mysql [general.log]  
grep -E ‘[string1]|[string2]|[stringN]’ [general.log] \> [output]

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.

---

<div class="post-metadata">

**Author:** ![Abhinav\_Gupta](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/abhinav_gupta/32/6262_2.png) [@Abhinav\_Gupta](https://forums.percona.com/u/Abhinav_Gupta)\
**Post date:** [December 4, 2024, 12:53pm UTC](https://forums.percona.com/t/named-pipe-for-general-log/35463/2 "2024-12-04T12:53:08Z")

</div>

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.

[https://dev.mysql.com/doc/refman/8.0/en/log-destinations.html](https://dev.mysql.com/doc/refman/8.0/en/log-destinations.html)

To enable it :

```auto
SET GLOBAL general_log = 'ON';
SET GLOBAL log_output = 'TABLE';

```

and to persist it, add these inside my.cnf as well :

```auto
[mysqld]
general_log = 1
log_output = TABLE

```

---

<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:** [December 5, 2024, 2:08pm UTC](https://forums.percona.com/t/named-pipe-for-general-log/35463/3 "2024-12-05T14:08:33Z")

</div>

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.
