Skip to content

Instantly share code, notes, and snippets.

@sorend
Created January 18, 2021 20:14
Show Gist options
  • Save sorend/9822e644e8cd07ea8a6e60f4b140e141 to your computer and use it in GitHub Desktop.
Save sorend/9822e644e8cd07ea8a6e60f4b140e141 to your computer and use it in GitHub Desktop.
<source>
@id kubernetes.log
@type tail
@label @containers
tag kubernetes.*
path /var/log/containers/*.log
exclude_path [
"/var/log/containers/fluentd-k8s-*.log",
"/var/log/containers/*_kube-system_*.log",
"/var/log/containers/*_flux-system_*.log",
"/var/log/containers/*_traefik-controller_*.log"
]
pos_file /var/log/kubernetes.log.pos
path_key source
read_from_head true
refresh_interval 60
<parse>
@type regexp
expression /^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$/
time_format %Y-%m-%dT%H:%M:%S.%N%:z
time_key time
time_type string
localtime false
</parse>
</source>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment