Common header
Every record in every DFE table starts with the common header, whatever the source sends. The loader fills it before insert, whichever transport the record arrived on (a Kafka topic or a gRPC push). The rest of the stack keys on it: row-level security on _org_id, time windows and partitions on its timestamps, and the console's time and organisation filters on the same columns. A change to a header field reaches every table the engine's schema phase creates and every query that filters on it, which is why the header moves only with its schema version.
The header's DDL belongs to dfe-schemas: its column types, ORDER BY, partitioning, codecs, indexes and TTL come from the timeseries, minimal and passthrough profiles under common-header/, rendered by dfe-schemas and applied by dfe-engine's schema phase. dfe-schemas' profile reference describes them, and make render in a dfe-schemas clone prints the DDL a deployment gets. This page covers what the loader writes into each column.
The header is the base of every table
In the timeseries profile the landing table holds the common header and nothing else, and every other table holds the same header plus data columns.
Figure 1. L4 Detail -- Common header against a complete table schema. The timeseries header (blue) is the same in each table, and non-default tables add data columns (green). Up: Transport.
- The landing table is
dfe.mainby default, another withrouting.default_table. It is the catch-all for unrouted records. - A profile decides which header columns a table gets. It never defines the data columns, which come from the table's schema in dfe-schemas.
- Every header column starts with
_, so it cannot collide with atimestamp,idortagsfield the source sends.
The loader creates no table, the landing table included. It reads the schema the deployment created and holds records for a table that does not exist yet in its pending-schema buffer.
What the loader writes
Types are the timeseries profile's as dfe-schemas renders them. The loader reads the live types from system.columns and encodes against those.
| Column | Type | What the loader writes |
|---|---|---|
_timestamp_load | DateTime64(3,'UTC') DEFAULT now64(3) | Nothing: the INSERT leaves it out and ClickHouse fills the load time |
_timestamp | DateTime64(3,'UTC') | The column's directive, first(timestamp/@timestamp/_timestamp) | now(): the first of those fields present, held to timestamp_dq, else the ingest time. A column with no directive reads timestamp, then _timestamp |
_timestamp_received | DateTime64(3,'UTC') | The first hop's _timestamp_received stamp, then the fields the column's directive names, then the ingest time |
_uuid | Nullable(UUID) DEFAULT generateUUIDv7() | Nothing: ClickHouse generates a time-ordered UUID |
_org_id | LowCardinality(String) | The routing.org_id_field value (default _org_id), else routing.default_org_id. No directive or sender field can change where it is read |
_source | LowCardinality(Nullable(String)) | The column's directive, first(_source) | topic_name: the record's _source, else the source its topic names |
_raw | Nullable(String) | A raw field the record sent (raw or _raw) under full, the whole payload under raw_only, else NULL |
_json | JSON(max_dynamic_paths=2048) | The received payload under full and json_only, spliced from the bytes as they arrived. A directive on the column, as on the DLQ table's @source: _json, fills it from the field it names under every mode |
_tags | JSON | The column's directive, first(_tags/tags/meta/metadata.tags), wrapped in an object (below) |
capture-modes.md covers _json and _raw, and routing.md covers _org_id and the topic's source.
A whole numeric epoch is read by magnitude as seconds, milliseconds, microseconds or nanoseconds, and a fractional one, 1788760433.5 say, is seconds, rewritten as the UTC text it names. A zoned text value, 2026-09-07T15:53:53.385+10:00 say, is rewritten as the UTC instant it names (2026-09-07T05:53:53.385Z), every fraction digit kept, so the offset is applied rather than dropped. The same rewrites apply to any DateTime or DateTime64 column the header pass fills. timestamp_dq holds _timestamp to max_future_seconds (default 600) and max_past_seconds (default 0, no lower bound). A value outside them, or one that does not parse once correct_known_bad has tried the known bad forms, becomes the ingest time.
A value no date-time reads, pmacct's 0000-00-00 00:00:00.000000 say, never fails the row. _timestamp and _timestamp_received take the ingest time, with timestamp_dq on or off, and any other date-time column leaves the value out, so its NULL or DEFAULT applies. Each one counts in dfe_loader_timestamp_replaced_total{reason, column}, and the value as sent stays in _json and _raw where the table keeps them.
JSON columns take an object
A ClickHouse JSON column accepts only an object at the top level, so the loader turns every value it writes into one, _tags included, whichever rule filled it and on both insert formats:
- An object is stored as it is.
- An array is stored under a
listkey: ECS shipstagsas an array, so["forwarded"]lands as{"list": ["forwarded"]}and queries read it as_tags.list. - A scalar, and text that does not parse as JSON, is stored under a
valuekey. Text that holds JSON is stored as the document it holds.
SELECT _tags.list.:`Array(Nullable(String))` AS tags
FROM dfe.main
WHERE arrayExists(x -> x = 'filebeat', _tags.list.:`Array(Nullable(String))`)
An object source passes through untouched, so _tags holding {"list": [...]} cannot be told apart from a source that sent that key itself.
When the header pass promotes nothing
A payload the header pass cannot read -- not JSON, not a JSON object, or a valid object matching no column in the table -- goes to the DLQ rather than landing as a row of type defaults with no _source and no _tags. Each rejection is counted in dfe_loader_header_pass_skipped_total, and an ERROR names the table and the reason at most once a minute. The table name stays out of the metric's labels: it comes from a payload field with no allowlist, so labelling it would let untrusted input grow the label set without bound.
Under full or json_only, a table with a _json column and no directive on it keeps the whole payload, so a field no column holds is still stored. A table without one, such as dfe-hyperdx's tables, keeps its columns and nothing else. Each top-level field that lands nowhere counts dfe_loader_fields_unstored_total, and a WARN names the table and the fields at most once a minute. DFE's _ header fields are not counted. A raw_only or extracted_only table with a _json column counts nothing either, because the check asks whether the table has the column, though _json is not written there.
The profiles
| Profile | Columns | Use case |
|---|---|---|
timeseries (default) | 9 | Full record ingestion |
minimal | 5: no _timestamp_received, _source, _raw or _tags | High-volume structured data |
passthrough | 4: _timestamp_load, _uuid, _org_id, _json | A transparent bridge, no _timestamp |
The profile YAML reaches the loader only as deployed ClickHouse columns, never as a file. See schemas.md.
| File | Purpose |
|---|---|
src/transform/extractor.rs | Fills the header columns on the default json_primary path |
src/clickhouse/schema.rs | Caches the deployed columns from system.columns |
src/column_meta/mod.rs | Parses the @directive annotations out of column comments |
src/schema/mod.rs | Parses table COMMENT tags |