通过 HTTPS 的 Filebeat

问题描述 投票:0回答:2

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

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

我知道我做错了什么,但我没有找到 Filebeat over HTTPS 的答案...

这是我的 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"

提前致谢。

elasticsearch elastic-stack filebeat elk
2个回答
4
投票

我发现了错误:

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

我已经更改了 instances.yml 中的 IP

然后我更改了我的 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

0
投票

您在instances.yml中将ip更改为什么?

© www.soinside.com 2019 - 2024. All rights reserved.