win10下使用docker容器启动Fluentd

本文档详细介绍了如何在Windows 10系统下利用Docker容器启动Fluentd。首先,需要拉取Fluentd的镜像,接着在指定目录创建并配置fluentd.conf文件,然后通过命令启动Fluentd服务。最后,发送请求并查看处理后的请求结果。
摘要由CSDN通过智能技术生成

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. 查看请求结果 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值