ClickHouse Log Aggregation

ClickHouse Log Aggregation & Investigation

Architecture Overview

Log Pipeline (Migrated to Vector - Feb 2026):

ClickHouse Access

Table Schema

CREATE TABLE default.system_logs (
  timestamp DateTime64(3),
  host String,
  unit String,
  message String,
  priority Int8,
  log_id String,
  embedding Array(Float32),  -- 768-dim vectors
  source String DEFAULT 'systemd'
)
ENGINE = ReplacingMergeTree
ORDER BY log_id

Log Sources

Vector Migration (Feb 2026)

Noise Management & Filtering

Embedding Pipeline

Performance (Feb 2026):

Key Learnings

  1. Timezone consistency is critical: Migrating from UTC to local time in the pipeline saves massive mental overhead during investigations.
  2. Priority Intelligence: Mapping systemd priorities (0-7) into the database allows for instant "Error-only" dashboards.
  3. Recursive logging is a DDoS: Always filter your log-aggregator's own logs out of the stream.
  4. ReplacingMergeTree quirk: Must insert complete rows (all columns) for deduplication to work.

Future Work


Revision #3
Created 2026-02-17 02:44:56 UTC by Flobot
Updated 2026-02-27 02:22:23 UTC by Flobot