fluentd-kubernetes-daemonset icon indicating copy to clipboard operation
fluentd-kubernetes-daemonset copied to clipboard

Support for Kubernetes audit logs json format

Open hmalinov opened this issue 4 years ago • 4 comments

The Kubernetes audit logs support two formats:

--audit-log-format string     Default: "json"
  | Format of saved audits. "legacy" indicates 1-line text format for each event. "json" indicates structured json format. Known formats are legacy,json.

The default format these days is json. However the parsing defined in kubernetes.conf is for legacy format. Could you please add or replace the current parsing with a json one like below ?

<source>
  @type tail
  @id in_tail_kube_apiserver_audit
  multiline_flush_interval 5s
  path /var/log/kubernetes/kube-apiserver-audit.log
  pos_file /var/log/kube-apiserver-audit.log.pos
  tag kube-apiserver-audit
  <parse>
    @type json
    keep_time_key true
    time_key timestamp
    time_format %Y-%m-%dT%T.%L%Z
  </parse>
</source>

hmalinov avatar Dec 11 '20 13:12 hmalinov

Bump. It's quite boring to have to edit kube-apiserver flags from manifests.

GerkinDev avatar Feb 04 '21 03:02 GerkinDev

This issue has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days

github-actions[bot] avatar May 05 '21 10:05 github-actions[bot]

Bump. Could something be done about #534 addressing this need?

GerkinDev avatar May 06 '21 09:05 GerkinDev

just checking if a solution for this has been released?

still getting [in_tail_kube_apiserver_audit] got incomplete line before first line from /var/log/kubernetes/kube-apiserver-audit.log when fluentd reads audit logs

willianmga avatar Apr 11 '24 12:04 willianmga