You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since kubernetes is deprecating docker log driver and using containerd instead. We need to support concat both containerd and docker in the same time to make sure upgrade kubernetes version seamlessly. I know readme has some example to concat for docker/containerd seperately. But when I use both, the log output is empty.
Steps to replicate
Provide example config and message
fluentd.conf
# This file collects and filters all Kubernetes container logs. Should rarely need to modify it.
# Do not directly collect fluentd's own logs to avoid infinite loops.
<match fluent.**>
@type null
</match>
<source>
@type tail
path /var/log/containers/*.log
pos_file /var/log/fluentd-containers.log.pos
tag kubernetes.*
read_from_head true
refresh_interval 2
rotate_wait 5
<parse>
@type multi_format
<pattern>
format regexp
expression /^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>[FP]) (?<log>.*)$/
time_format %Y-%m-%dT%H:%M:%S.%NZ
keep_time_key true
</pattern>
<pattern>
format json
time_key @timestamp
time_format %Y-%m-%dT%H:%M:%S.%NZ
keep_time_key true
</pattern>
</parse>
</source>
<filter kubernetes.**>
@type kubernetes_metadata
watch false
</filter>
# Exclude events from Geneva containers since they just seem to echo events from other containers
<filter kubernetes.var.log.containers.geneva**.log>
@type grep
<exclude>
key log
pattern .*
</exclude>
</filter>
# Concat containerd partial log
# https://github.com/fluent/fluentd-kubernetes-daemonset/issues/412#issuecomment-636536767
<filter **>
@id containerd_concat
@type concat
key log
use_first_timestamp true
partial_key logtag
partial_value P
separator ""
</filter>
# Concat log truncated by docker 16KB limit
<filter **>
@id filter_concat
@type concat
key log
use_first_timestamp true
multiline_end_regexp /\n$/
separator ""
</filter>
# Flatten fields nested within the 'log' field
<filter kubernetes.var.log.containers.**.log>
@type parser
format json
key_name log
reserve_data true
</filter>
# Flatten fields nested within the 'kubernetes' field and remove unnecessary fields
<filter kubernetes.var.log.containers.**.log>
@type record_transformer
enable_ruby
<record>
ContainerName ${record["kubernetes"]["container_name"]}
NamespaceName ${record["kubernetes"]["namespace_name"]}
PodName ${record["kubernetes"]["pod_name"]}
Node ${record["kubernetes"]["host"]}
</record>
remove_keys docker,kubernetes,stream,log
</filter>
# Anything else goes to standard output
<match **>
@type stdout
</match>
I guess that <filter **> cause such a result because ** applies both of them.
It may be better to use the exact match for docker log driver or containerd separately.
@kenhys In my case, containerd_concat and filter_concat capture log from same workload group, but in different version kubernetes cluster. So I can't diff them with exact match label.
Problem
Since kubernetes is deprecating docker log driver and using containerd instead. We need to support concat both containerd and docker in the same time to make sure upgrade kubernetes version seamlessly. I know readme has some example to concat for docker/containerd seperately. But when I use both, the log output is empty.
Steps to replicate
Provide example config and message
Expected Behavior
Log should be parsed and concat seamlessly for both containerd/docker log format.
Your environment
fluentd --version
ortd-agent --version
fluent-gem list
,td-agent-gem list
or your Gemfile.lockThe text was updated successfully, but these errors were encountered: