nephelaiio.filebeat
nephelaiio.filebeat
这是一个 ansible 角色,用于安装和配置 filebeat。
角色变量
请参阅 defaults 文件 以获取最新的输入参数列表。
依赖关系
请查看 依赖配置 以获取更多详细信息。
示例剧本
- name: 部署 filebeat
hosts: 服务器
vars:
filebeat_package_state: latest
filebeat_conf_manage: true
filebeat_conf:
fields:
environment: development
inputs:
- type: log
paths:
- /var/log/system.log
- /var/log/wifi.log
- type: log
paths:
- "/var/log/nginx/*.log"
fields:
application: nginx
output:
elasticsearch:
enabled: true
hosts:
- http://localhost:9200
setup:
dashboards:
enabled: true
beat: filebeat
always_kibana: true
template:
enabled: true
kibana:
host: http://localhost:80
roles:
- role: nephelaiio.filebeat
测试
请确保您的环境中已安装 docker,以便运行角色验证测试。额外的 Python 依赖项列在 requirements 文件 中。
该角色在以下发行版(docker 镜像)中经过测试:
- Ubuntu Jammy
- Ubuntu Focal
- Debian Bookworm
- Debian Bullseye
- Rocky Linux 9
您可以使用命令 molecule test
直接从源代码测试该角色。
许可证
该项目根据 MIT 许可证 授权。