Skip to content

Instantly share code, notes, and snippets.

@0sc
Created July 14, 2019 22:36
Show Gist options
  • Save 0sc/c5d88f58aafca0c3b507c69589fcd6e3 to your computer and use it in GitHub Desktop.
Save 0sc/c5d88f58aafca0c3b507c69589fcd6e3 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-logging
namespace: kube-system
labels:
app: fluentd-logging
data:
fluent.conf: |
<source>
@type tail
path /var/log/*.log
pos_file /var/log/fluentd/tmp/access.log.pos
tag foo.*
<parse>
@type json
</parse>
</source>
<source>
@type tail
@id in_tail_container_logs
path /var/log/containers/*.log
pos_file /var/log/fluentd-containers.log.pos
tag kubernetes.*
read_from_head true
<parse>
@type json
time_format %Y-%m-%dT%H:%M:%S.%NZ
</parse>
</source>
<match fluentd.**>
@type null
</match>
<match kubernetes.var.log.containers.**fluentd**.log>
@type null
</match>
<filter kubernetes.**>
@type kubernetes_metadata
@id filter_kube_metadata
</filter>
<match kubernetes.var.log.containers.**>
@type stdout
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment