Debian jessie image with fluentd log collector.
The following plugin will also be installed:
/etc/fluentFluent configuration directory, expect fluent.conf file.
Collect all containers logs and send them to elasticsearch container.
docker run --link elastic:elastic -d -v /var/lib/docker/containers:/var/lib/docker/containers fluentd
:warning: We have an elasticsearch container named elastic, so we forward log to ELASTIC_PORT_9200_TCP_ADDR.
fluentd.conf
<source>
type tail
read_from_head true
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
</source>
# Using filter to add container IDs to each event
<filter docker.var.lib.docker.containers.*.*.log>
type record_transformer
<record>
container_id ${tag_parts[5]}
</record>
</filter>
<match docker.var.lib.docker.containers.*.*.log>
type elasticsearch
logstash_format true
host "#{ENV['ELASTIC_PORT_9200_TCP_ADDR']}" # dynamically configured to use Docker's link feature
port 9200
flush_interval 5s
</match>
MIT © Maxime Loliée
Content type
Image
Digest
sha256:5950a3927…
Size
354.6 MB
Last updated
about 11 years ago
docker pull loliee/fluentd