Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fluentd-使用python发送json_Python_Fluentd - Fatal编程技术网

Fluentd-使用python发送json

Fluentd-使用python发送json,python,fluentd,Python,Fluentd,我有一个Fluentd服务器,配置为通过TCP接受json数据,并在匹配时将其输出到std。配置为: <source> @type tcp tag json_logs port 12312 format json bind 0.0.0.0 </source> <match **> @type stdout </match> 发现问题-Fluentd服务器仅接受使用“ASCII”编码接收的数据 from pyfluent.client

我有一个Fluentd服务器,配置为通过TCP接受json数据,并在匹配时将其输出到std。配置为:

<source>
 @type tcp
 tag json_logs
 port 12312
 format json
 bind 0.0.0.0
</source>

<match **>
@type stdout
</match>

发现问题-Fluentd服务器仅接受使用“ASCII”编码接收的数据

from pyfluent.client import FluentSender
logdata = '{ "prop1": "val1", "prop2": "val2" }'
fluent = FluentSender("host", 12312, "json_logs")
fluent.send(logdata)