禁用日志“logstash. output.elasticsearch”

wqnecbli  于 2022-11-02  发布在  ElasticSearch
关注(0)|答案(1)|浏览(146)

我想禁用日志中输出的连续警告消息,

[2022-09-20T20:28:54,604][WARN ][logstash.outputs.elasticsearch][main] Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://elasticsearch:9200/", :exception=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :message=>"Got response code '401' contacting Elasticsearch at URL 'http://elasticsearch:9200/'"}

我读了很多帖子,xpack.monitoring.enabled: false似乎对人们有用。

http.host: "0.0.0.0"
path.config: /usr/share/logstash/pipeline
pipeline.ecs_compatibility: disabled
xpack.monitoring.enabled: false

但是我还是不断收到那些警告信息,有没有办法摆脱它们?

r8uurelv

r8uurelv1#

xpack.monitoring.enabled仅用于将监视(但不记录!!)数据发送到Elasticsearch。
您可以动态更新Logstash日志级别,如下所示

curl -XPUT 'localhost:9600/_node/logging?pretty' -H 'Content-Type: application/json' -d'
{
    "logger.logstash.outputs.elasticsearch" : "ERROR"
}
'

或直接在log4j.properties文件中

logger.elasticsearchoutput.name = logstash.outputs.elasticsearch
logger.elasticsearchoutput.level = error

相关问题