繁体   English   中英

使用格式json时,fluentd splunk-http-eventcollector插件错误请求400

[英]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 truesplunk-http-eventcollector

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM