Then, download Fluentd edge-debian's (edge-debian means latest version of Fluentd) image by docker pull command:
$ docker pull fluent/fluentd:edge-debian
Debian 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.
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:
(Note: For Windows users, it is recommended to run this command in Command Prompt (cmd.exe). If using PowerShell, the JSON string may require different escaping rules to be parsed correctly.)
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: