DavidWittman.filebeat
Ansible Filebeat 角色
安装 Elastic 的 Filebeat 以转发日志。
角色变量
filebeat_version
- 要安装的 filebeat 版本,默认为6.4.2
。filebeat_state
- 默认为present
。设置为absent
可卸载 filebeat。filebeat_config
- filebeat 配置的 YAML 表示。这会直接模板化到配置文件中。有关详细的配置选项,请参见 示例配置。默认值为:
filebeat_config:
filebeat:
prospectors:
- paths:
- /var/log/messages
- /var/log/*.log
input_type: log
output:
file:
path: /tmp/filebeat
filename: filebeat
logging:
to_syslog: true
level: error
filebeat_ca_cert
- 如果提供,变量的内容将被放置在目标主机上由filebeat_ca_path
指定的文件中。然后可以在配置中包含filebeat_ca_path
以正确验证 TLS 连接到 Logstash/Elasticsearch 等。
如果希望从文件加载 CA 证书,请使用 file
查找插件,例如:
filebeat_ca_cert: "{{ lookup('file', '/path/to/ca.crt') }}"
filebeat_ca_path
- 如果在filebeat_ca_cert
中提供了 CA 证书,它将被创建在此路径。
类似于 CA 变量,您可以使用这些变量上传 filebeat 的 SSL 证书和密钥:
filebeat_ssl_cert
- SSL 证书的内容filebeat_ssl_cert_path
- 证书在 Ansible 控制的主机上的目的地filebeat_ssl_key
- SSL 密钥的内容filebeat_ssl_key_path
- SSL 密钥在 Ansible 控制的主机上的目的地
您还可以将配置存储在单独的 filebeat.yml
文件中,并使用 查找 包含它:
filebeat_config: "{{ lookup('file', './filebeat.yml')|from_yaml }}"
常见配置
连接到 Elasticsearch:
filebeat_config:
filebeat:
prospectors:
- paths:
- /var/log/messages
- /var/log/*.log
input_type: log
output:
elasticsearch:
hosts:
- "http://localhost:9200"
username: "bob"
password: "12345"
logging:
to_syslog: true
level: error
许可
BSD
作者信息
David Wittman
安装
ansible-galaxy install DavidWittman.filebeat
许可证
Unknown
下载
909
拥有者
Dev, Ops, Security, Lens Flares