Expand description
Elasticsearch access-logger (elasticsearch-logger).
Ships access-log entries to Elasticsearch via its _bulk API. 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 newline-delimited JSON (NDJSON) to
<endpoint>/_bulk.
Ports APISIX’s elasticsearch-logger: the bulk envelope pairs an
{"index":{"_index":<name>}} action line with each entry line, exactly as
get_logger_entry does in the Lua plugin.
§Deviations from APISIX
- No Elasticsearch version probe. APISIX issues a
GET /to detect the ES major version and, for ES 5/6, adds_type: "_doc"to the action line. featherbit targets ES 7+ and never emits_type, so it performs no version-probe callout. - Static index name. APISIX resolves
{time}strftime tokens and$varreferences infield.indexper request againstctx.var. Because entries are flushed in batches without a request context, featherbit usesfield.indexas a literal string.
Structs§
- Elasticsearch
Logger Plugin - Node that batches access-log entries and ships them to Elasticsearch.
- EsFlusher 🔒
- Delivers batches to Elasticsearch’s
_bulkendpoint.
Functions§
- build_
bulk_ 🔒body - Builds the NDJSON
_bulkbody: for every entry an action line{"index":{"_index":<index>}}followed by the entry, each terminated by a newline (APISIXget_logger_entry). Pure and network-free for testing. - collect_
endpoints 🔒 - Reads
endpoint_addr(string) and/orendpoint_addrs(array), trims trailing slashes, and errors when none are present.