Filebeat over HTTPS



我是elk的新手,但我目前正在通过docker compose部署elk堆栈(https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.htmlTLS部分(。

Elasticsearch和Kibana在HTTPS中正常工作

但是,我不知道如何通过HTTPS启用Filebeat。我想发送我的nginx日志,它位于另一台服务器上(通过互联网,所以我不想以明文形式发送日志(。在HTTP中一切都很好,但当我切换到HTTPS并重新加载Filebeat时,我会收到以下消息:

Error: ... Get https://10.15.0.12:9200: x509: certificate is valid for 127.0.0.0.1, not 10.15.0.12

我知道我做错了什么,但我找不到HTTPS上Filebeat的答案。。。

这是我的Filebeat配置:

output.elasticsearch:
# Array of hosts to connect to.
hosts: ["10.15.0.12:9200"]
# Protocol - either `http` (default) or `https`.
protocol: "https"
# Authentication credentials - either API key or username/password.
username: "elastic"
password: "myelasticpassword"

提前谢谢。

我发现错误:

我的自签名证书适用于127.0.0.1主机。

我已经更改了实例中的IP。yml

然后我更改了我的filebeat配置:

output.elasticsearch:
# Array of hosts to connect to.
hosts: ["xx.xx.xx.xx:9200"]
# Protocol - either `http` (default) or `https`.
protocol: "https"
# Authentication credentials - either API key or username/password.
#api_key: "id:api_key"
username: "elastic"
password: "mypassword"
ssl.verification_mode: none

最新更新