From d8b51c726755e334c3fe9ccca4ba3a3f60abd243 Mon Sep 17 00:00:00 2001 From: Patrick Birch <48594400+patrickbirch@users.noreply.github.com> Date: Tue, 30 Dec 2025 08:50:26 -0600 Subject: [PATCH] PS-10333 [DOCS] Minimum and maximum values should be mentioned for audit log variables 8.0 modified: docs/audit-log-filter-variables.md modified: docs/audit-log-plugin.md --- docs/audit-log-filter-variables.md | 11 ++++++++++- docs/audit-log-plugin.md | 24 ++++++++++++++++++++---- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/docs/audit-log-filter-variables.md b/docs/audit-log-filter-variables.md index e2cd40d9ab0..56f072b08de 100644 --- a/docs/audit-log-filter-variables.md +++ b/docs/audit-log-filter-variables.md @@ -511,6 +511,8 @@ mysql> SELECT audit_log_read_bookmark(); | Data type | Integer | | Unit | Bytes | | Default | 32768 | +| Minimum value | 0 | +| Maximum value | 18446744073709551615 | This option is only supported for JSON-format files. @@ -611,6 +613,10 @@ Pruning requires the following options: | Scope | Global | | Data type | Integer | | Default | 1GB | +| Minimum value | 0 | +| Maximum value | 18446744073709551615 | +| Unit | bytes | +| Block size | 4096 | Performs an automatic log file rotation based on the size. The default value is 1GB. If the value is greater than 0, when the log file size exceeds the value, the plugin renames the current file and opens a new log file using the original name. @@ -626,7 +632,7 @@ If you set the value to less than 4096, the plugin does not automatically rotate | Data type | Integer | | Default | 0 | | Minimum value | 0 | -| Maximum value | 1844674073709551615 | +| Maximum value | 18446744073709551615 | | Unit | seconds | Defines when the audit log filter file is pruned. This pruning is based on the age of the file. The value is measured in seconds. @@ -904,6 +910,9 @@ For high-security environments, consider increasing this value to 100000 or high | Scope | Global | | Data type | Integer | | Default | 0 | +| Minimum value | 0 | +| Maximum value | 18446744073709551615 | +| Unit | days | Defines when passwords may be removed and measured in days. diff --git a/docs/audit-log-plugin.md b/docs/audit-log-plugin.md index 5192a77391f..069a01107c9 100644 --- a/docs/audit-log-plugin.md +++ b/docs/audit-log-plugin.md @@ -24,8 +24,8 @@ As of [Percona Server for MySQL 8.4.7-7](https://docs.percona.com/percona-server The audit Log plugin is installed, but, by default, is not enabled when you install Percona Server for MySQL. To check if the plugin is enabled run the following command. This command searches for plugins with names containing the word "audit" in the `information_schema.PLUGINS` table. -```{.bash data-prompt="mysql>"} -mysql> SELECT * FROM information_schema.PLUGINS WHERE PLUGIN_NAME LIKE '%audit%'; +```sql +SELECT * FROM information_schema.PLUGINS WHERE PLUGIN_NAME LIKE '%audit%'; ``` The empty result suggests that no such plugins are installed or loaded. @@ -699,8 +699,14 @@ When this variable is set to `ON` log file will be closed and reopened. | Dynamic: | No | | Data type | Numeric | | Default value | 1 Mb | +| Minimum value | 4096 | +| Maximum value | 1073741824 (1 GB) | +| Unit | bytes | +| Block size | 4096 | + +This variable specifies the size of the memory buffer used for logging. It is only effective when `audit_log_strategy` is set to `ASYNCHRONOUS` or `PERFORMANCE` and `audit_log_handler` is set to `FILE`. -This variable can be used to specify the size of memory buffer used for logging, used when audit_log_strategy variable is set to `ASYNCHRONOUS` or `PERFORMANCE` values. This variable has effect only when audit_log_handler is set to `FILE`. +The value is automatically rounded to the nearest multiple of 4096. ### `audit_log_exclude_accounts` @@ -831,13 +837,19 @@ are: | Dynamic: | Yes | | Data type | Numeric | | Default value | 0 | +| Minimum value | 0 | +| Maximum value | 18446744073709551615 | +| Unit | bytes | +| Block size | 4096 | This variable is measured in bytes and specifies the maximum size of the audit log file. Upon reaching this size, the audit log will be rotated. The rotated log files are present in the same directory as the current log file. The sequence number is appended to the log file name upon rotation. -If the value is set to 0 (the default), the audit log files won’t rotate. +If the value is set to 0 (the default), the audit log files won't rotate. + +If you set the value to less than 4096, the plugin does not automatically rotate the log files. If the value is not a multiple of 4096, the plugin truncates the value to the nearest multiple. Set the `audit_log_handler` to FILE to enable this variable. @@ -850,11 +862,15 @@ Set the `audit_log_handler` to FILE to enable this variable. | Dynamic: | Yes | | Data type | Numeric | | Default value | 0 | +| Minimum value | 0 | +| Maximum value | 100 | This variable is used to specify how many log files should be kept when audit_log_rotate_on_size variable is set to non-zero value. This variable has effect only when audit_log_handler is set to `FILE`. +The maximum value is typically capped at 100 to prevent excessive file handle or disk overhead, though some internal implementations may allow up to 4294967295. + ### `audit_log_handler` | Option | Description |