Repository navigation
v2.16.1
Logging for Elastic
- New LOG_FORMAT=ecs: JSON with Elastic Common Schema field names
(@timestamp in UTC, log.level, message, service., user.name,
user_agent.original, client.ip, http.request.method, url.path,
http.response.status_code, http.request.id, event.action,
event.duration in ns, error.message, trace.id). Everything else goes
under openconsole.. So the namespace / pod / container an action ran
against never collides with the shipper's kubernetes.* / container.*
metadata, and nothing clashes with the ECS index templates. - deploy/deployment.yaml now sets LOG_FORMAT=ecs. LOG_FORMAT=json keeps
the previous field names for Loki / Vector or existing queries. - Fix: client-go's own messages (klog: watch errors, throttling,
reflector failures) were written as plain text, even with
LOG_FORMAT=json. They now go through the same logger, so every line is
one JSON object. - deploy/elk: an Elasticsearch ingest pipeline, mappings and an
idempotent install.sh for Elastic Agent's Kubernetes integration. The
pipeline:- decodes only OpenConsole's lines and keeps Agent's kubernetes.* /
container.* / log.file.path; - sets event.outcome on audit events;
- routes records to logs-openconsole.audit-* and logs-openconsole.app-*
with typed fields (client.ip as ip, durations and status codes as
long).
Tested on Elasticsearch 8.15.3 with lines from this image, sent the way
the Kubernetes integration sends them.
- decodes only OpenConsole's lines and keeps Agent's kubernetes.* /
- README "Shipping logs to Elastic" has ready-to-use configurations:
- Elastic Agent with Fleet: run deploy/elk/install.sh;
- Elastic Agent standalone / Filebeat: a filestream input with the
container and ndjson parsers; - Logstash: the json filter.
Upgrade note
- If you apply deploy/deployment.yaml, the field names change to ECS.
Kibana searches or dashboards built on the old names (user, msg,
status, …) need the new ones (user.name, message,
http.response.status_code, …). Keep LOG_FORMAT=json if you prefer the
old names.
Image: ghcr.io/vurulkan/kubernetes-openconsole:2.16.1 = :latest (same digest), linux/amd64 + linux/arm64, with GitHub-attested provenance and SBOM.
🤖 Generated with Claude Code