[英]fluentd splunk-http-eventcollector plugin Bad Request 400 when using format json
我正在尝试使用fluentd作为守护程序将日志从Kubernetes中散发出来。
当我将format none
设置为format none
并按下时,它会起作用。 但是我想添加kubernetes_metadata,所以我更新了format json
并添加了kubernetes_metadata
过滤器。
然后,我收到了400错误请求
{"text": "Invalid data format", "code": 6, "invalid-event-number": 0 }
这是我的fluent.conf文件
# Ignore fluentd log messages
<match fluent.**>
@type null
</match>
<source>
@type tail
path /var/log/containers/*.log
pos_file /fluentd/log/docker-containers.log.pos
tag kubernetes.*
format json
read_from_head true
</source>
<filter kubernetes.**>
@type kubernetes_metadata
</filter>
<match kubernetes.**>
@type splunk-http-eventcollector
server <host>:8088
protocol https
verify false
token ***
source fluentd-kube-containers
sourcetype _json
host "#{ENV['HOSTNAME']}"
buffer_chunk_limit 700k
batch_size_limit 1000000
buffer_type file
buffer_path /fluentd/log/fluentd-buffer
flush_interval 10s
</match>
这是我的愚蠢,我的源代码不是json
格式,所以splunk不喜欢它,我的假设是我需要在源代码上设置format json
以获得kubernetes元数据是错误的,所以当我将format none
设置为format none
并添加all_items true
于splunk-http-eventcollector
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.