Skip to content

Commit 311992f

Browse files
committed
PS-9954 [DOCS] - Update Audit Log Filter examples 8.4
modified: docs/reading-audit-log-filter-files.md
1 parent bb9606d commit 311992f

5 files changed

+59
-57
lines changed

docs/audit-log-filter-restrictions.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44

55
The Audit Log Filter has the following general restrictions:
66

7-
* Logs only SQL statements. Statements made by NoSQL APIs, such as the Memcached API, are not logged.
7+
The Audit Log Filter has the following general restrictions:
8+
9+
* Log only SQL statements. Statements made by NoSQL APIs, such as the
10+
Memcached API, are not logged.
811

9-
* Logs only the top-level statement. Statements within a stored procedure or a trigger are not logged. Does not log the file contents for statements like `LOAD_DATA`.
12+
* Log only the top-level statement. Statements within a stored procedure
13+
or a trigger are not logged. Do not log the file contents for statements
14+
like `LOAD_DATA`.
1015

11-
* If used with a cluster, the component must be installed on each server used to execute SQL on the cluster.
16+
* Require the component to be installed on each server used to execute SQL
17+
on the cluster if used with a cluster.
1218

13-
* If used with a cluster, the application or user is responsible for aggregating all the data of each server used in the cluster.
19+
* Hold the application or user responsible for aggregating all the data from
20+
each server used in the cluster if used with a cluster.

docs/audit-log-filter-variables.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ This function returns either an `OK` for success or an error message for failure
288288

289289
```{.bash data-prompt="mysql>"}
290290
mysql> SET @filter = '{ "filter_name": { "log": true }}'
291-
mysql> SET audit_log_filter_set_filter('filter-name', @filter);
291+
mysql> SELECT audit_log_filter_set_filter('filter-name', @filter);
292292
```
293293

294294
??? example "Expected output"
@@ -342,24 +342,24 @@ mysql> SELECT audit_log_filter_set_user('user-name@localhost', 'filter-name');
342342
| Name |
343343
| --- |
344344
| [`audit-log-filter`](#audit-logvalue) |
345-
| [`audit_log_filter.buffer_size`](#audit_log_filter_buffer_size) |
346-
| [`audit_log_filter.compression`](#audit_log_filter_filter_compression) |
347-
| [`audit_log_filter.database`](#audit_log_filter.database) |
348-
| [`audit_log_filter.disable`](#audit_log_filter_disable) |
349-
| [`audit_log_filter.encryption`](#audit_log_filter_encryption) |
350-
| [`audit_log_filter.file`](#audit_log_filter_file) |
351-
| [`audit_log_filter.format`](#audit_log_filter_format) |
352-
| [`audit_log_filter.format_unix_timestamp`](#audit_log_filter_format_unix_timestamp) |
353-
| [`audit_log_filter.handler`](#audit_log_filter_handler) |
354-
| [`audit_log_filter.key_derivation_iterations_count_mean`](#audit_log_filter_key_derivation_iterations_count_mean) |
355-
| [`audit_log_filter.max_size`](#audit_log_filter_max_size) |
356-
| [`audit_log_filter.keep_password_history_keep_days`](#audit_log_filter_keep_password_history_keep_days) |
357-
| [`audit_log_filter.prune_seconds`](#audit_log_filter_prune_seconds) |
358-
| [`audit_log_filter.read_buffer_size`](#audit_log_filter_read_buffer_size) |
359-
| [`audit_log_filter.rotate_on_size`](#audit_log_filter_rotate_on_size) |
360-
| [`audit_log_filter.strategy`](#audit_log_filter_strategy) |
361-
| [`audit_log_filter.syslog_tag`](#audit_log_filter_syslog_tag) |
362-
| [`audit_log_filter.syslog_priority`](#audit_log_filter_syslog_priority) |
345+
| [`audit_log_filter.buffer_size`](#audit_log_filterbuffer_size) |
346+
| [`audit_log_filter.compression`](#audit_log_filtercompression) |
347+
| [`audit_log_filter.database`](#audit_log_filterdatabase) |
348+
| [`audit_log_filter.disable`](#audit_log_filterdisable) |
349+
| [`audit_log_filter.encryption`](#audit_log_filterencryption) |
350+
| [`audit_log_filter.file`](#audit_log_filterfile) |
351+
| [`audit_log_filter.format`](#audit_log_filterformat) |
352+
| [`audit_log_filter.format_unix_timestamp`](#audit_log_filterformat_unix_timestamp) |
353+
| [`audit_log_filter.handler`](#audit_log_filterhandler) |
354+
| [`audit_log_filter.key_derivation_iterations_count_mean`](#audit_log_filterkey_derivation_iterations_count_mean) |
355+
| [`audit_log_filter.max_size`](#audit_log_filtermax_size) |
356+
| [`audit_log_filter.password_history_keep_days`](#audit_log_filterpassword_history_keep_days) |
357+
| [`audit_log_filter.prune_seconds`](#audit_log_filterprune_seconds) |
358+
| [`audit_log_filter.read_buffer_size`](#audit_log_filterread_buffer_size) |
359+
| [`audit_log_filter.rotate_on_size`](#audit_log_filterrotate_on_size) |
360+
| [`audit_log_filter.strategy`](#audit_log_filterstrategy) |
361+
| [`audit_log_filter.syslog_tag`](#audit_log_filtersyslog_tag) |
362+
| [`audit_log_filter.syslog_priority`](#audit_log_filtersyslog_priority) |
363363

364364
### `audit_log_filter.buffer_size`
365365

@@ -505,7 +505,7 @@ This option does nothing when used with other format types.
505505

506506
Defines where the component writes the audit log filter file. The following values are available:
507507

508-
* `FILE` - component writes the log to a location specified in [`audit_log_filter.file`](#audit_log_filter_file)
508+
* `FILE` - component writes the log to a location specified in [`audit_log_filter.file`](#audit_log_filterfile)
509509
* `SYSLOG` - component writes to the syslog
510510

511511

@@ -547,13 +547,15 @@ A value greater than 0 (zero) enables pruning based on size and defines the comb
547547

548548
The value is based on 4096 (block size). A value is truncated to the nearest multiple of the block size. If the value is less than 4096, the value is treated as 0 (zero).
549549

550-
If the values for `audit_log_filter.rotate_on_size` and `audit_log_filter.max_size` are greater than 0, we recommend that `audit_log_filter.max_size` value should be at least seven times the `audit_log_filter.rotate_on_size` value.
550+
If the values for [`audit_log_filter.rotate_on_size`](#audit_log_filterrotate_on_size) and [`audit_log_filter.max_size`](#audit_log_filtermax_size) are greater than 0, we recommend that `audit_log_filter.max_size` value should be at least seven times the `audit_log_filter.rotate_on_size` value.
551551

552552
Pruning requires the following options:
553553

554-
* `audit_log_filter.max_size`
555-
* `audit_log_filter.rotate_on_size`
556-
* `audit_log_filter.prune_seconds`
554+
* [`audit_log_filter.rotate_on_size`](#audit_log_filterrotate_on_size)
555+
556+
* [`audit_log_filter.max_size`](#audit_log_filtermax_size)
557+
558+
* [`audit_log_filter.prune_seconds`](#audit_log_filterpruneseconds)
557559

558560

559561
### `audit_log_filter.password_history_keep_days`
@@ -574,7 +576,7 @@ The default value is 0 (zero). This value disables the expiration of passwords.
574576

575577
If the component starts and encryption is enabled, the component checks for an audit log filter encryption password. If a password is not found, the component generates a random password.
576578

577-
Call `audit_log_filter_encryption_set()` to set a specific password.
579+
Call [`audit_log_filter_encryption_set()`](#audit_log_filter_encryption_set) to set a specific password.
578580

579581

580582
### `audit_log_filter.prune_seconds`
@@ -598,8 +600,8 @@ A value greater than 0 enables pruning. An audit log filter file can be pruned a
598600

599601
To enable log pruning, you must set one of the following:
600602

601-
* Enable log rotation by setting `audit_log_filter.rotate_on_size`
602-
* Add a value greater than 0 (zero) for either `audit_log_filter.max_size` or `audit_log_filter.prune_seconds`
603+
* Enable log rotation by setting [`audit_log_filter.rotate_on_size`](audit_log_filterrotate_on_size)
604+
* Add a value greater than 0 (zero) for either [`audit_log_filter.max_size`](audit_log_filtermax_size) or [`audit_log_filter.prune_seconds`](audit_log_filterprune_seconds)
603605

604606

605607
### `audit_log_filter.read_buffer_size`
@@ -615,7 +617,7 @@ To enable log pruning, you must set one of the following:
615617

616618
This option is only supported for JSON-format files.
617619

618-
The size of the buffer for reading from the audit log filter file. The `audit_log_filter_read()` reads only from this buffer size.
620+
The size of the buffer for reading from the audit log filter file. The [`audit_log_filter_read()`](audit_log_filter_read) reads only from this buffer size.
619621

620622
### `audit_log_filter.rotate_on_size`
621623

docs/disable-audit-log-filter.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
# Disable Audit Log Filter logging
22

3-
The `audit_log_filter.disable` system variable lets you disable or enable logging for all connections.
3+
The `audit_log_filter.disable` system variable lets you disable or enable logging for all connections based on the value:
4+
5+
| Value | Actions |
6+
|---|---|
7+
| `audit_log_filter.disable = true` |Disables logging. |
8+
| `audit_log_filter.disable = false` | Enables logging. |
49

510
You can set the variable in the following ways:
611

7-
* Option file
8-
* Command-line startup string
9-
* SET statement during runtime
12+
* Specify in the option file.
13+
14+
* Include in the command-line startup string.
1015

16+
* Use a SET statement during runtime.
1117

1218
```{.bash data-prompt="mysql>"}
1319
mysql> SET GLOBAL audit_log_filter.disable = true;
1420
```
1521

16-
Setting `audit_log_filter.disable` has the following effect:
17-
18-
| Value | Actions |
19-
|---|---|
20-
| true | Generates a warning. Audit log function calls and changes in variables generate session warnings. Disables the component. |
21-
| false | Re-enables the component and generates a warning. This is the default value. |
22-
2322
## Privileges required
2423

2524
Setting the value of `audit_log_filter.disable` at runtime requires the following:

docs/filter-audit-log-filter-files.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,30 +152,22 @@ Add filter_update_on_user_change.
152152
```{.bash data-prompt="mysql>"}
153153
mysql> SELECT audit_log_filter_set_filter('log_connect', '{
154154
"filter": {
155-
"class": {
156-
"name": "connection",
157-
"event": {
158-
"name": "connect"
159-
}
160-
}
155+
"class": { "name": "connection" },
156+
"event": { "name": "connect" }
161157
}
162158
}');
163159

164160
mysql> SELECT audit_log_filter_set_filter('log_disconnect', '{
165161
"filter": {
166-
"class": {
167-
"name": "connection",
168-
"event": {
169-
"name": "disconnect"
170-
}
171-
}
162+
"class": { "name": "connection" },
163+
"event": { "name": "disconnect" }
172164
}
173165
}');
174166
```
175167

176168
| Option | Filters | Example | Event |
177169
|-------------|---------------------------------------------|--------------------------------|-------------------------------------------|
178-
| class | general, connection, table_access | N/A | general: Server-wide events, query processing<br>connection: Login, logout, connection attempts<br>table_access: Database and table-level interactions |
170+
| class | general, connection, table_access | N/A | General: Server-wide events, query processing<br>connection: Login, logout, connection attempts<br>table_access: Database and table-level interactions |
179171
| user | Filters by MySQL user accounts | ["admin", "readonly_user"] | All actions performed by specified users |
180172
| database | Filters by database name | ["sales", "inventory"] | Operations within specified databases |
181173
| table | Filters by table name | ["customers", "orders"] | Interactions with specific tables |

docs/reading-audit-log-filter-files.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ If the file is renamed and no longer fits the pattern, the file is ignored.
99
The following functions read the files in the JSON-format:
1010

1111
* [`audit_log_read`](audit-log-filter-variables.md#audit_log_read) - reads audit log filter events
12-
* [`audit_log_read_bookmark()](audit-log-filter-variables.md#audit_log_read_bookmark) - for the most recently read event, returns a bookmark. The bookmark can be passed to `audit_log_read()`.
12+
13+
* [`audit_log_read_bookmark`](audit-log-filter-variables.md#audit_log_read_bookmark) - for the most recently read event, returns a bookmark. This bookmark can be passed to `audit_log_read()`.
1314

1415
Initialize a read sequence by using a bookmark or an argument that specifies the start position:
1516

1617
```{.bash data-prompt="mysql>"}
1718
mysql> SELECT audit_log_read(audit_log_read_bookmark());
19+
```
1820

1921
The following example continues reading from the current position:
2022

0 commit comments

Comments
 (0)