我正在尝试在ElasticSearch集群上设置EFK (ElasticSearch 8、FluentD和Kibana)堆栈(现场)。
我遵循这个链接安装elasticsearch,并使用helm图表安装它,并遵循这个链接安装fluentd
fluentd和elasticsearch的输出
[root@ctrl01 ~]# kubectl get pods
NAME READY STATUS RESTARTS AGE
elasticsearch-master-0 1/1 Running 0 136m
[root@ctrl01 ~]# kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
fluentd-cnb7p 1/1 Running 0 107m
fluentd-dbxjk 1/1 Running 0 107m
但是,elasticsearch日志中堆放了以下警告消息
2021-10-18 12:13:12 +0000 [warn]: temporarily failed to flush the buffer. next_retry=2021-10-18 12:13:42 +0000 error_class="Elasticsearch::Transport::Transport::Errors::BadRequest" error="[400] {\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"Action/metadata line [1] contains an unknown parameter [_type]\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"Action/metadata line [1] contains an unknown parameter [_type]\"},\"status\":400}" plugin_id="out_es"
2021-10-18 12:13:12 +0000 [warn]: suppressed same stacktrace
Conf文件(定制输出)
2021-10-18 12:09:10 +0000 [info]: using configuration file: <ROOT>
<match fluent.**>
@type null
</match>
<source>
@type tail
@id in_tail_container_logs
path /var/log/containers/*.log
pos_file /var/log/fluentd-containers.log.pos
tag kubernetes.*
read_from_head true
format json
time_format %Y-%m-%dT%H:%M:%S.%NZ
</source>
<source>
@type tail
@id in_tail_minion
path /var/log/salt/minion
pos_file /var/log/fluentd-salt.pos
tag salt
format /^(?<time>[^ ]* [^ ,]*)[^\[]*\[[^\]]*\]\[(?<severity>[^ \]]*) *\] (?<message>.*)$/
time_format %Y-%m-%d %H:%M:%S
</source>
我不知道它指的是哪个'type'
字段。我找不到ElasticSearch 8的例子来比较match
和source
指令
从ES 8开始,type
字段似乎是而不是支持的,但我不确定。请告诉我错误的原因。
发布于 2022-06-29 19:49:29
当我试图在fluentBit 1.9.5中使用ElasticSearch8.2.3时,也遇到了类似的错误。我可以看到弹性发送日志,但没有看到任何数据在基班纳网页,因为这不能创建索引,并看到上述错误在流畅位荚日志。我遵循这个github问题,并在输出项下添加了Suppress_Type_Name到上:在我的流畅位舵机图表values.yaml文件中的章节中,它在那之后工作得很好。
[OUTPUT]
Name es
Match *
Host {{ .Values.global.backend.es.host }}
Port {{ .Values.global.backend.es.port }}
Logstash_Format Off
Retry_Limit False
Type _doc
Time_Key @timestamp
Replace_Dots On
Suppress_Type_Name On
Index {{ .Values.global.backend.es.index }}
{{ .Values.extraEntries.output }}
发布于 2022-06-16 06:39:05
我在同一问题上工作了几天,我找到了一个解决方案,但只是一个解决办法,而不是最佳解决方案。
如果将TypeName
ElasticsearchSinkOptions
**,的设置为null,则不会面临此问题。**
不幸的是,您不能从appsettings.json设置它。至少我找不到办法。
在背景中,Serilog.Sinks.ElasticSearch
库在header中将此属性用作_type
。但是“_type”头,作为leandrojmp在评论中指出,在ElasticSearch的8.2版中不再可用。
https://stackoverflow.com/questions/69617608
复制相似问题