Hub
Database

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.

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-mysql-audit/generator.yml \
  --id mysql \
  --live-mode true

Event Types

Event IDDescriptionFrequencyCategory
query-selectSELECT queries on tables and views~30.0%database
connectSuccessful client connections~13.5%authentication
disconnectClient disconnections~12.7%authentication
query-updateUPDATE statements~11.3%database
query-insertINSERT statements~7.6%database
table-access-readTable read access events~7.5%database
table-access-writeTable write access (insert/update/delete)~4.4%database
query-adminAdmin commands (SHOW, FLUSH, OPTIMIZE)~4.2%database
connect-failureFailed authentication attempts~2.8%authentication
query-errorFailed queries (syntax, permission, deadlock)~1.7%database
query-deleteDELETE statements~2.3%database
query-ddlDDL: CREATE, ALTER, DROP (tables, indexes, views)~1.2%configuration
query-grantGRANT/REVOKE privilege changes~0.8%iam

Realism Features

  • Session-correlated events — connect creates a session reused by query/table_access templates, disconnect pops it, ensuring consistent user/IP/connection context
  • 5-host MySQL fleet — production pair, staging, reporting, and dev instances with unique agent IDs, IPs, and MySQL server IDs
  • 12 MySQL users — root, application service accounts (app_service, web_api, etl_loader), reporting, admin (jsmith, mchen), dev, backup, monitoring, and replication users with weighted selection
  • Parameterized SQL statements — schema-qualified queries with realistic WHERE clauses and parameterized values across multiple databases
  • Query statistics — bytes_received, bytes_sent, query_time, rows_examined, rows_sent for every general-class event
  • Monotonic counters — per-host event IDs and connection IDs increment across all templates
  • Failed authentication with error codes — incorrect passwords, unknown users, and host-blocked connection failures

Sample Output

{
    "@timestamp": "2026-03-06T14:22:31.456789+00:00",
    "agent": {
        "id": "b3c4d5e6-f7a8-9012-bcde-f01234567891",
        "name": "mysql-prod-01",
        "type": "filebeat",
        "version": "8.17.0"
    },
    "client": {
        "domain": "app-server-01",
        "ip": "192.168.1.50",
        "port": 45678
    },
    "data_stream": {
        "dataset": "mysql_enterprise.audit",
        "namespace": "default",
        "type": "logs"
    },
    "event": {
        "action": "mysql-query",
        "category": ["database"],
        "dataset": "mysql_enterprise.audit",
        "kind": "event",
        "module": "mysql_enterprise",
        "outcome": "success",
        "type": ["access"]
    },
    "mysqlenterprise": {
        "audit": {
            "account": { "host": "app-server-01", "user": "app_service" },
            "class": "general",
            "connection_id": "142",
            "general_data": {
                "command": "Query",
                "query": "SELECT * FROM `ecommerce`.`orders` WHERE `id` = ?",
                "sql_command": "select",
                "status": 0
            },
            "id": "1042",
            "login": { "ip": "192.168.1.50", "user": "app_service" },
            "query_statistics": {
                "bytes_received": 78,
                "bytes_sent": 4521,
                "query_time": 0.001234,
                "rows_examined": 1,
                "rows_sent": 1
            }
        }
    },
    "user": { "name": "app_service" }
}

Parameters

ParameterDefaultDescription
agent_version8.17.0Filebeat/Elastic Agent version string

Related Generators