Public Repository

Last pushed: a month ago
Short Description
FluentD logging container with the ElasticSearch plugin installed
Full Description

Fluentd ElasticSearch docker image

This container image is to create endpoint to collect logs on your host and ship them to an elasticsearch instance.

docker run -d -p 24224:24224 yipeeio/fluentd-elasticsearch
Default configuration is to:

  • listen port 24224 for fluentd forward protocol
  • forward logs with index logstash-* to an elasticsearch instance at http://elastic:9200

This image uses Alpine Linux.

Configuration ENV variables

Environment variables below are configurable to control how to execute fluentd process:

FLUENTD_CONF

For configuring the configuration file name, though this will negate the use of the ELASTIC_SEARCH_* environment variables below if you supply your own custom fluent.conf. If you want to use your own configuration file, you can use it with the ENV variable and the -v option.

  1. write configuration file with filename mycustomfluent.conf
  2. execute docker run -e FLUENT_CONF=mycustomfluent.conf -v path/to/conf/dir:/fluentd/etc. This will share /path/to/conf/dir/mycustomfluent.conf with the container at /fluent/etc/mycustomfluent.conf and instruct fluentd to use that configuration.

FLUENTD_OPT

Use this variable to specify other options to fluentd, such as -v or -q.

ELASTIC_SEARCH_HOSTS

Use this variable to provide the URI(s) of the elasticsearch instance(s) to which you'd like to ship logs. Defaults to "http://elasticsearch:9200".

ELASTIC_SEARCH_USER

ELASTIC_SEARCH_PASSWD

Use these variables if you need to authenticate to the elasticsearch instance. Defaults to not being set.

ELASTIC_SEARCH_FLUSH_INTERVAL

Use this variable to set how long the logs will be buffered before flushing (sending) them to the elasticsearch instance. Should be a string which includes the time units. Default is "2s".

Examples

Log to elasticsearch.example.com with no authentication:
docker run -d -e ELASTIC_SEARCH_HOSTS=http://elasticsearch.example.com:9200 yipeeio/fluentd-elasticsearch

Log to elasticsearch.example.com on the default port using HTTP and flush buffers every 10 seconds:
docker run -d -e ELASTIC_SEARCH_HOSTS=elasticsearch.example.com -e ELASTIC_SEARCH_FLUSH_INTERVAL=10s yipeeio/fluentd-elasticsearch

Log to elasticsearch.example.com on port 9999 using HTTPS with no authentication:
docker run -d -e ELASTIC_SEARCH_HOSTS=https://elasticsearch.example.com:9999 yipeeio/fluentd-elasticsearch

Log to elasticsearch.example.com on port 9999 using HTTPS with authentication:
docker run -d -e ELASTIC_SEARCH_HOSTS=https://elasticsearch.example.com:9999 -e ELASTIC_SEARCH_USER=my_es_user ELASTIC_SEARCH_PASSWD=my_secret_es_password yipeeio/fluentd-elasticsearch

References

fluent/fluentd | DockerHub

Docker Pull Command
Owner
yipeeio

Comments (0)