I'm wondering if someone can point me in the right direction.
With the in_tail plugin is there a way to exclude specific files?
I wish to ignore the docker container running fluentd from sending logs, the pattern in use is as follows.
If new files are created by creating new docker containers, I wish this to be logged too.
path /var/lib/docker/containers/*/*-json.log
The full configuration can be found below.
Thanks
Andy
<ROOT>
<source>
type tail
path /var/lib/docker/containers/*/*-json.log
pos_file /var/log/fluentd-docker.pos
time_format %Y-%m-%dT%H:%M:%S
tag docker.*
format json
refresh_interval 1m
</source>
<match docker.var.lib.docker.containers.*.*.log>
type record_reformer
container_id ${tag_parts[5]}
tag docker.all
</match>
<match docker.all>
type copy
<store>
type file
path /var/log/docker/*.log
format json
include_time_key true
log_level debug
</store>
<store>
type s3
s3_bucket photobox-services-logs
s3_region eu-west-1
path logs/docker
s3_object_key_format %{path}/events/ts=%{time_slice}/%{container_id}/events_%{index}-%{hostname}.%{file_extension}
buffer_path /var/log/fluent/s3
time_slice_format %Y-%m-%d-%H
time_slice_wait 10m
utc
buffer_chunk_limit 256m
flush_interval 1m
</store>
</match>
</ROOT>