1. 拉取fluentd镜像
docker pull fluent
2. 在目录D:\usr\share\fluentd下新建配置文件fluentd.conf,文件内容为
<source>
@type http
port 9880
bind 0.0.0.0
</source>
<match **>
@type stdout
</match>
3. 执行命令,启动fluentd
docker run -p 9880:9880 -v /d/usr/share/fluentd:/fluentd/etc -e FLUENTD_CONF=fluentd.conf fluentd:latest
4. 发送请求
curl -X POST --header "Content-Type:application/json" --data-raw "{\"json\":{\"json\": \"hello2\"}}" http://localhost:9880/sample.test
curl -X POST --data "json={\"msgpack\":\"message\"}" http://localhost:9880/sample.test
5. 查看请求结果