Filebeat“加载配置文件时出错:yaml:未找到预期的密钥"
我被堆在这个问题上.
我有一台启用了x-pack安全性的Elasticsearch服务器.具有Filebeat的客户端正在将输出发送到该服务器.所有人都在不启用x-pck安全的情况下正常工作,但是这样做,实际上是我收到此错误消息.
I have an Elasticsearch server with x-pack security enabled. A client with Filebeat that is sending outputs to that server. All is working fin without enabling x-pck security, but whe doing it, in the lient I have this error message.
./filebeat test config -v
Exiting: error loading config file: yaml: line 157: did not find expected key
导致错误的行是用户名"和密码".注释后,配置测试可以,但是取消对用户名和密码的注释后,则会出现错误
The line that causes the error is the "username" and "password". When commented, the config test is OK, but when username and password is uncommented the error appears
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch.hosts: ["X.X.X.X:9200"]
# Array of hosts to connect to.
#hosts: ["localhost:9200"]
# Protocol - either `http` (default) or `https`.
#protocol: "http"
# Authentication credentials - either API key or username/password.
#api_key: "id:api_key"
username: "elastic"
password: "<password_generated_in_server>"
连接可以很好地处理XGET请求,如下所示:
Connection is working fine with a XGET request like this:
curl -XGET 'http://X.X.X.X:9200/_all/_search?q=*&pretty' -u elastic:<password_generated_in_server>
我需要启用任何x-pack模块,选件还是手动创建用户?
Do I need to acivate any x-pack module, option or create the user manually?
我启用的模块是system,elasticsearch和auditd.我在客户端使用了go build.
My enabled modules are system, elasticsearch and auditd. Im using a go build for arm in the client.
谢谢
已解决.
似乎配置文件的语法非常严格...这种方式可以正常工作:
It seems the configuration file is pretty strict in the syntax... This way is working fine:
setup.kibana:
host: "http://X.X.X.X:5601"
output.elasticsearch:
hosts: ["http://X.X.X.X:9200"]
username: "elastic"
password: "<passwd>"