Skip to content

Configuration

Avinash Gupta edited this page Oct 18, 2026 · 1 revision

Configuration

One YAML file with six blocks. This page explains each one and the choices you'll make. The full config reference in the README lists every key with its default.

sources:   # which databases (required)
sinks:     # where records go (required; every sink gets every record)
state:     # where checkpoints and the DLQ live
runtime:   # polling, batching, concurrency
metrics:   # Prometheus endpoint
logging:   # rdstail's own logs (stderr, JSON)

Validate before running:

rdstail validate -c rdstail.yaml          # schema only, offline
rdstail validate -c rdstail.yaml --deep   # also probes AWS, sinks and state store

Sources

A source is a region (or list of regions) plus a way to pick instances.

sources:
  # explicit list; engine auto-detected per instance (mixing engines is fine)
  - type: rds
    region: us-east-1
    instances: [orders-db, billing-db]

  # everything in several regions, with an opt-out tag
  - type: rds
    regions: [us-east-1, eu-west-1]
    discover:
      all: true
      exclude_tags: {rdstail: "off"}
      refresh_interval: 5m            # pick up new DBs, drop deleted ones

  # only databases tagged for it, in another account
  - type: rds
    region: us-east-1
    assume_role: arn:aws:iam::222222222222:role/rdstail-reader
    discover:
      tags: {team: payments, env: prod}   # AND: every tag must match
Key Use
engine Optional. Set it to force one engine and to filter discovery to it
include_audit MySQL/MariaDB: also ship audit-plugin files (audit/server_audit.log*). pgAudit always flows: it's in postgresql.log
assume_role Read RDS in another account
discover.refresh_interval ≥ 30s. 0 = discover once at startup

Preview what a config selects: rdstail discover -c rdstail.yaml. More in Scaling.

Sinks

Every sink receives every record unless it has a filter. Each sink has its own retry policy, and failures that outlast it park in the DLQ instead of blocking.

S3 (archive)

- name: archive
  type: s3
  s3:
    bucket: my-log-bucket
    region: us-east-1
    prefix: rds/
    kms_key_id: ""          # empty → SSE-S3 (AES256); set → SSE-KMS
    assume_role: ""         # write to a bucket in another account
    external_id: ""

Objects: <prefix>/<instance>/<engine>/<log file>/YYYY/MM/DD/<unix-ms>-<batch_id>.ndjson.gz. Query them with Athena or DuckDB. For immutable audit storage see the compliance guide.

Kafka (real-time consumers)

- name: stream
  type: kafka
  kafka:
    brokers: [kafka-1:9092, kafka-2:9092]
    topic_template: "rds-logs-{engine}"   # or a fixed `topic:`
    tls: true
    sasl_mechanism: scram-sha-512         # plain | scram-sha-256 | scram-sha-512
    sasl_username: rdstail
    sasl_password: ${KAFKA_PASSWORD}

acks=all, idempotent, zstd-compressed. Messages are keyed by instance|log_file, so each file stays in order, and they carry batch-id and instance-id headers.

HTTP webhook (SIEMs, log vendors, your own service)

- name: siem
  type: http
  filter:
    min_severity: ERROR       # only ERROR / FATAL / PANIC reach this sink
  http:
    url: https://logs.example.com/ingest
    headers:
      Authorization: Bearer ${SIEM_TOKEN}
    gzip: true
    timeout: 30s

One POST per batch with a JSON array body. 2xx = delivered; 4xx → DLQ immediately; 5xx/timeouts → retry. Keep batches under the receiver's payload limit with runtime.max_batch_bytes / max_batch_records.

stdout (pipes)

- name: pipe
  type: stdout
  stdout:
    format: ndjson            # ndjson (full record) | text (raw lines)

rdstail's own logs go to stderr, so stdout is pure data: rdstail run -c cfg.yaml | vector --config vector.yaml.

Filters and retries (any sink)

  filter:
    min_severity: WARNING          # DEBUG < LOG/INFO/NOTICE/NOTE/SYSTEM < WARNING < ERROR < FATAL < PANIC
    # severities: [FATAL, PANIC]   # or an exact list
  retry:
    max_attempts: 10
    initial_wait: 500ms
    max_wait: 60s
    multiplier: 2.0

Records without a severity (continuation lines, unparsed formats) never pass min_severity. Unfiltered sinks still receive them.

The record

Every sink receives the same JSON record:

{
  "instance_id": "orders-db",
  "engine": "postgres",
  "log_file": "error/postgresql.log.2026-10-17-08",
  "timestamp": "2026-10-17T08:25:41.123456Z",
  "severity": "ERROR",
  "message": "2026-10-17 08:25:41 UTC:10.0.1.5(53422):app@orders:[12345]:ERROR:  deadlock detected",
  "marker": "4:12345",
  "batch_id": "a1b2c3d4e5f60708"
}
  • timestamp is the engine's event time when the line has one (fetch time otherwise). severity is the engine's own level, omitted when absent.
  • message is the raw text, never rewritten. Multi-line entries (slow-query blocks, wrapped SQL) are one record with embedded newlines.
  • batch_id is deterministic per fetched chunk. Use it to dedupe the rare re-delivery after a crash.
  • audit (pgAudit class/command/object) and truncated (a > 1 MB line) appear only when relevant.

State

state:
  type: sqlite                # default; `file` is a JSON fallback without DLQ support
  path: /var/lib/rdstail/state.db

Holds per-file checkpoints and the DLQ. Keep it on local persistent disk, one file per process. See Production Setup → State.

Runtime

The defaults suit most fleets. The ones you're most likely to touch:

runtime:
  poll_interval: 10s          # base poll rate
  poll_interval_max: 5m       # adaptive: idle DBs back off to this, snap back on data
  start_from: end             # end | beginning (first sight of an instance only)
  max_batch_bytes: 5242880    # per sink write
  checkpoint_retention: 168h  # prune checkpoints for long-gone files

Every knob and when to change it: Performance and Throughput.

Metrics and logging

metrics:
  enabled: true
  listen: :9090               # /metrics, /healthz, /readyz
logging:
  level: info                 # debug | info | warn | error; JSON on stderr

See Monitoring.

Secrets and environment overrides

${VAR} anywhere in the YAML is replaced from the environment at load time:

headers:
  Authorization: Bearer ${SIEM_TOKEN}

An unset variable is left as the literal ${NAME}, so it fails loudly at the receiver (and parks in the DLQ) instead of silently becoming empty.

Any key can also be overridden with RDSTAIL_ + the path, using __ for nesting:

RDSTAIL_RUNTIME__POLL_INTERVAL=5s RDSTAIL_LOGGING__LEVEL=debug rdstail run -c rdstail.yaml

Example configs

File Topology
config.yaml 2 sources, 2 sinks
s3-only.yaml PostgreSQL fleet → S3
kafka-only.yaml MySQL fleet → Kafka with topic_template
http-webhook.yaml one instance → webhook with gzip
datadog.yaml direct to Datadog
fanout.yaml S3 and Kafka
discover.yaml tag-based discovery
stdout.yaml NDJSON pipe for vector / fluent-bit / jq
audit-archive.yaml audit logs → immutable S3
stack-loki-grafana/ full search + alerting stack (recipe)

Clone this wiki locally