MariaDB Audit Plugin File Log
MariaDB Community Server 11.4.4 server_audit FILE records (connections, queries and table locks) of an application connection pool, DBAs and delegated accounts, as the native 10-field CSV in event.original with parsed mariadb.audit.* and ECS fields. About 16,700 records a day follow a UTC working day. Recurring episodes put three or four failed DBA logins in front of a temporary GRANT, the delegate's read, the REVOKE and a denial.
Quick Start
uv tool install eventum-generator
git clone https://github.com/eventum-generator/content-packs.git
cd content-packs
eventum generate \
--path generators/database-mariadb-audit/generator.yml \
--id database-mariadb-audit \
--live-mode trueEvent Types
| Event ID | Description | Frequency | Category |
|---|---|---|---|
| QUERY | Completed COM_QUERY statement with its result code | 48.6% of records, about 8,118 a day | database (plus iam for GRANT/REVOKE) |
| READ | Successful read table lock taken by the statement | 31.5% of records, about 5,265 a day | database |
| WRITE | Successful write table lock taken by the statement | 17.2% of records, about 2,865 a day | database |
| DISCONNECT | End of a successful or failed connection | 1.34% of records, about 224 a day | authentication |
| CONNECT | Successful login, current database set | 1.29% of records, about 215 a day | authentication |
| FAILED_CONNECT | Wrong password, retcode 1045, empty database | 0.05% of records, about 9 a day without episodes; about 0.07% and 12 a day with them | authentication |
Realism Features
- Volume follows a UTC hour-of-day curve: 0.28 records/s at 08-19, 0.18 at 07-08 and 19-21 and 0.10 at 21-07, about 16,700 records a day with ±3% day-to-day variation. The curve repeats every day, so weekends look like weekdays. Rates are chosen assumptions, not vendor-measured frequencies.
- Three long-lived connections of the application account write about 96% of the records: point SELECT (65%), UPDATE (25%) and INSERT (10%) against 50 orders tables, a median of 51 statements per connection, each connection replaced after a median 30 minutes. DBAs and delegates work mostly in business hours, about 4.7 sessions an hour at 08-18 UTC and 0.1 at night, a median of 2 statements 25 s apart; up to seven sessions are open at once.
- About 11 temporary grants a day, mostly in business hours: a DBA grants a delegate SELECT on one sensitive table, the delegate reads it one to five times, the DBA revokes the grant, and a median 200 s later the delegate's next attempt is denied with 1142. GRANTs of one DBA are at least 30 minutes apart, and up to two temporary grants exist at once.
- Failed logins are about 4% of login attempts, about 9 a day: mistyped passwords retried after a median 8 s, give-ups, and stale-password bursts of 2 to 5 failures within seconds. Runs of three or more failures followed by a login occur two to three times a week for the two DBAs together; about twice a week such a run reaches a DBA's grant maintenance, and that DBA then works on the sensitive tables without a GRANT.
- Record semantics follow the tagged 11.4.4 source: table lock records precede their QUERY with the same query ID and second and an empty retcode (a lock was taken, not rows returned), 1142 denials and 1064 syntax errors take no lock, a failed login closes in the same second with an empty database, and the COM_QUIT that ends a session consumes a query ID. event.created is the collection time: the same second in half of the records, within 8 s for 90%, up to about two minutes at night.
- With anomaly_mode true, each episode adds three or four failed logins of one DBA and one GRANT, REVOKE and 1142 denial: at the default interval the DBAs' failed logins are about 1.7 times the background level (about 8.5 instead of 5 a day), and runs of three or more failures followed by a login occur about 9-10 times a week instead of two or three.
- No unmodified production audit file was available: the field grammar comes from the tagged source and its regression result, the GRANT/REVOKE system-table records are derived from source rather than a captured trace, and ID values, timing and workload are synthetic. FILE output only; neither the SYSLOG output of this version nor the client ports and TLS details added in 12.x are modelled. Clients send no connect-time statements, connection ids increase by one per connection, and there is one application server.
- ECS fields beyond the parsed native slots are collector-side enrichment. No maintained Elastic integration covers server_audit and no SIEM parser was run. The records do not show why logins failed, which rows were returned, or data exfiltration.
Sample Output
{
"@timestamp": "2026-10-12T10:26:30+00:00",
"ecs": {
"version": "8.17.0"
},
"event": {
"action": "query",
"category": [
"database",
"iam"
],
"created": "2026-10-12T10:26:35.421863+00:00",
"dataset": "mariadb.audit",
"ingested": "2026-10-12T10:26:35.421863+00:00",
"kind": "event",
"original": "20261012 10:26:30,db-01.corp.example,dba_ops,10.99.4.52,1081,4771,QUERY,payroll,'GRANT SELECT ON payroll.bonuses TO \\'report_user\\'@\\'10.99.5.22\\'',0",
"outcome": "success",
"type": [
"change"
]
},
"host": {
"ip": [
"10.100.0.5"
],
"name": "db-01.corp.example"
},
"log": {
"file": {
"path": "/var/log/mariadb/server_audit.log"
}
},
"mariadb": {
"audit": {
"connectionid": 1081,
"database": "payroll",
"host": "10.99.4.52",
"object": "GRANT SELECT ON payroll.bonuses TO 'report_user'@'10.99.5.22'",
"operation": "QUERY",
"queryid": 4771,
"retcode": 0,
"serverhost": "db-01.corp.example",
"timestamp": "20261012 10:26:30",
"username": "dba_ops"
}
},
"message": "20261012 10:26:30,db-01.corp.example,dba_ops,10.99.4.52,1081,4771,QUERY,payroll,'GRANT SELECT ON payroll.bonuses TO \\'report_user\\'@\\'10.99.5.22\\'',0",
"observer": {
"hostname": "db-01.corp.example",
"ip": [
"10.100.0.5"
],
"product": "MariaDB Community Server",
"type": "database",
"vendor": "MariaDB",
"version": "11.4.4"
},
"related": {
"ip": [
"10.99.4.52"
],
"user": [
"dba_ops"
]
},
"service": {
"type": "mariadb",
"version": "11.4.4"
},
"source": {
"ip": "10.99.4.52"
},
"tags": [
"mariadb-audit",
"preserve_original_event"
],
"user": {
"name": "dba_ops"
}
}Parameters
| Parameter | Default | Description |
|---|---|---|
| anomaly_mode | true | Add episodes to background; false produces background only |
| anomaly_interval_hours | 24 | Episode interval in hours of source time, 6 to 8,760 |
| db_host | db-01.corp.example | Server host name in the serverhost slot; ASCII letters, digits, dot and hyphen, up to 253 characters |
| db_ip | 10.100.0.5 | Server IPv4 address, enrichment only |
| normal_user | app_user | Application account used by the connection pool |
| normal_ip | 10.100.1.20 | Application server IPv4 address |
| dba_accounts | [{user: dba, ip: 10.99.4.51}, {user: dba_ops, ip: 10.99.4.52}] | DBA pool, 1 to 4 entries of user and ip; the DBA or table pool needs two or more entries |
| delegated_accounts | [{user: audit_user, ip: 10.99.5.21}, {user: report_user, ip: 10.99.5.22}] | Accounts that receive temporary grants, 1 to 4 entries of user and ip |
| normal_database | appdb | Database of the 50 application tables |
| sensitive_database | payroll | Database of the sensitive tables |
| sensitive_tables | [salaries, bonuses] | Sensitive tables, 1 to 8 distinct entries; the DBA or table pool needs two or more entries |
Related Generators
Microsoft SQL Server Audit
SQL Server Audit via Windows Event ID 33205 — login/logout lifecycle, DML queries (SELECT/INSERT/UPDATE/DELETE), stored procedure execution, schema changes (CREATE/ALTER/DROP), permission management (GRANT/DENY/REVOKE), role membership, backups, DBCC commands, and password changes.
MySQL Audit
MySQL Enterprise Audit Plugin events (ECS-compatible JSON) covering all four audit classes — connection, general, table_access, and audit. Generates connect/disconnect lifecycle, DML queries (SELECT/INSERT/UPDATE/DELETE), table access tracking, DDL schema changes, GRANT/REVOKE privileges, admin commands, query errors, and failed authentication attempts with realistic query statistics.
PostgreSQL Audit Logs
PostgreSQL with pgAudit — SELECT/INSERT/UPDATE/DELETE queries with parameterized statements, connection lifecycle, authentication failures, DDL operations, role management (GRANT/REVOKE), and database errors (deadlocks, constraint violations).