Expand description
ClickHouse access-logger (clickhouse-logger).
Ships access-log entries to ClickHouse over its HTTP interface. Each request
builds one log entry (the shared build_entry shape, or a custom
log_format) that is handed to a fire-and-forget BatchSink; a
background task POSTs batches as an
INSERT INTO <logtable> FORMAT JSONEachRow statement whose body is the
newline-delimited JSON entries.
Ports APISIX’s clickhouse-logger: the SQL prefix, the JSONEachRow
payload, and the X-ClickHouse-User / X-ClickHouse-Key /
X-ClickHouse-Database auth headers all mirror send_http_data in the Lua
plugin.
§Deviations from APISIX
- APISIX joins multiple encoded entries with a single space; featherbit
joins with a newline. ClickHouse’s
JSONEachRowformat accepts either as a row separator, so the ingested rows are identical.
Structs§
- Clickhouse
Flusher 🔒 - Delivers batches to a ClickHouse HTTP endpoint.
- Clickhouse
Logger Plugin - Node that batches access-log entries and inserts them into ClickHouse.
Functions§
- build_
insert_ 🔒body - Builds the request body: an
INSERT INTO <logtable> FORMAT JSONEachRowstatement followed by the newline-joined JSON entries (APISIXsend_http_data). Pure and network-free for testing. - collect_
endpoints 🔒 - required_
string 🔒