是否可以配置 filebeat 以使用令牌身份验证与 Elastic Cloud 实例通信?
根据文档,如果我使用的是云实例,我应该配置cloud.id
并cloud.auth
在filebeat.yml
cloud.id: "..."
cloud.auth: "filebeat_setup:YOUR_PASSWORD"
文档说这cloud.auth
应该是我的 Elastic Cloud 实例中的用户名和密码。我想改用 api_key 。但是,当我配置API 密钥时
output.elasticsearch:
# Authentication credentials - either API key or username/password.
api_key: "key-id:key-value"
并尝试测试我的连接,
$ sudo filebeat test output
elasticsearch: https://...:443...
parse url... OK
connection...
parse host... OK
dns lookup... OK
addresses: 52.202.123.120, 18.214.74.184, 50.19.154.221
dial up... OK
TLS...
security: server's certificate chain verification is enabled
handshake... OK
TLS version: TLSv1.2
dial up... OK
talk to server... ERROR 401 Unauthorized: {"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
似乎filebeat
不承认我的 API 密钥
"root_cause":[
{
"type":"security_exception",
"reason":"missing authentication credentials for REST request [/]"
/* ... */
我已经成功地@elastic/elasticsearch
使用这个令牌通过 javascript 包连接到我的云实例。
在我继续调试这个问题之前——甚至可以使用令牌身份验证通过连接到 Elasticsearchfilebeat
吗?还是filebeat
只支持用户名/密码认证?