Docker Image
This article explains how to use the official Fluentd Docker image, maintained by Treasure Data, Inc.
Step 0: Install Docker
Please download and install Docker from here:
Step 1: Pull Fluentd Docker Image
Then, download Fluentd edge-debian's (edge-debian means latest version of Fluentd) image by docker pull command:
$ docker pull fluent/fluentd:edge-debianDebian and Alpine Linux versions are available for Fluentd image. Debian version is recommended officially since it has jemalloc support. However, the Alpine image is smaller. And, Windows server version is also available.
Step 2: Launch Fluentd Container
To make the test simple, create the example config below at $(pwd)/tmp/fluentd.conf. This example accepts records from http, and outputs to stdout.
# $(pwd)/tmp/fluentd.conf
<source>
@type http
port 9880
bind 0.0.0.0
</source>
<match **>
@type stdout
</match>Finally, you can run Fluentd with docker run command:
Step 3: Post Sample Logs via HTTP
Use curl command to post sample logs via HTTP like this:
Use docker ps command to retrieve container ID and use docker logs command to check the specific container's log like this:
Next Steps
Now, you know how to use Fluentd via Docker.
Here are some Docker related resources for Fluentd:
Also, refer to the following tutorials to learn how to collect data from various data sources:
Basic Configuration
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is an open-source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.
Last updated
Was this helpful?