Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

Docker Image: fluentd

Debian jessie image with fluentd log collector.

The following plugin will also be installed:

  • fluent-plugin-elasticsearch

Volumes

/etc/fluent

Fluent configuration directory, expect fluent.conf file.

Example usage

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>

Licence

MIT © Maxime Loliée

Docker Pull Command
Owner
loliee
Source Repository

Comments (0)