You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/audit-log-filter-new.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The filter writes the audit log filter file in XML. The XML file uses
4
4
UTF-8.
5
5
6
6
The <AUDIT> is the root element and this element contains
7
-
<AUDIT_RECORD> elements. Each <AUDIT_RECORD> element contains specific
7
+
<AUDIT_RECORD> elements. Each <AUDIT_RECORD> element contains specific
8
8
information about an event that is audited.
9
9
10
10
For each new file, the Audit Log Filter component writes the XML
@@ -76,7 +76,7 @@ closing element is not available.
76
76
</AUDIT>
77
77
```
78
78
79
-
The order of the attributes within an <AUDIT_RECORD> can vary. Certain attributes are in every element. Other attributes are optional and depend on the type of audit record.
79
+
The order of the attributes within an <AUDIT_RECORD> can vary. Certain attributes are in every element. Other attributes are optional and depend on the type of audit record.
80
80
81
81
The attributes in every element are the following:
Copy file name to clipboardExpand all lines: docs/audit-log-filter-old.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Audit Log Filter format - XML (old style)
2
2
3
-
The old style XML format uses `<AUDIT>` tag as the root element and adds the `</AUDIT>` tag when the file closes. Each audited event is contained in an <AUDIT_RECORD> element.
3
+
The old style XML format uses `<AUDIT>` tag as the root element and adds the `</AUDIT>` tag when the file closes. Each audited event is contained in an <AUDIT_RECORD> element.
4
4
5
-
The order of the attributes within an <AUDIT_RECORD> can vary. Certain attributes are in every element. Other attributes are optional and depend on the type of audit record.
5
+
The order of the attributes within an <AUDIT_RECORD> can vary. Certain attributes are in every element. Other attributes are optional and depend on the type of audit record.
Copy file name to clipboardExpand all lines: docs/write-filter-definitions.md
+27-12Lines changed: 27 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -350,24 +350,31 @@ Performance impact is a critical consideration when implementing detailed loggin
350
350
351
351
## Implement the filter
352
352
353
-
Here's how to define and implement an audit log filter:
353
+
Here's how to define and implement an audit log filter in Percona Server for MySQL 8.4.6:
354
354
355
-
### Add filter identifier
355
+
### Create a filter
356
356
357
-
An audit log filter identifier is your filter's unique name within the `audit_log_filter` system. You create this name to label and track your specific filter setup. The `audit_log_filter_id` system variable stores this name, and you should choose descriptive identifiers like 'finance_audit' or 'security_tracking'.
357
+
To create an audit log filter, use the `audit_log_filter_set_filter()` function. This function takes two parameters: the filter name and the filter definition as a JSON string.
358
358
359
-
After you name your filter with an identifier, you attach your rules. The identifier makes it easy to manage multiple filter setups and update them as needed. When you want to change your logging rules, you first reference your chosen identifier and then add your new filter settings.
Remember that when you apply new filter settings to an existing identifier, the system replaces the old settings. It doesn't add the new rules to what's already there.
365
+
To assign a filter to specific users, use the `audit_log_filter_set_user()` function. This function takes three parameters: username, userhost, and filtername.
362
366
363
367
```sql
364
-
SET GLOBAL audit_log_filter_id ='financial_tracking';
The filter monitors two main types of activities. First, it watches all changes to your accounts and transactions tables. This monitoring means that the filter logs when someone adds new data, changes existing information, or removes records. You get a complete picture of who's touching your financial data and what they do with it.
@@ -413,9 +423,14 @@ The filter focuses only on activity in your `financial_db` database. This target
413
423
Tracking all these elements gives you a comprehensive view of who's accessing your financial data, what changes they're making, and whether those changes are successful. This ability is beneficial for security monitoring and compliance requirements.
414
424
415
425
416
-
To verify your filter:
426
+
To verify your filter, you can check the audit tables:
427
+
417
428
```sql
418
-
SHOW GLOBAL VARIABLES LIKE'audit_log_filter';
429
+
-- Check created filters
430
+
SELECT*FROMmysql.audit_log_filter;
431
+
432
+
-- Check user assignments
433
+
SELECT*FROMmysql.audit_log_user;
419
434
```
420
435
421
436
You can examine your audit log file (the default location is the data directory) to check if events are being logged.
0 commit comments