1、7.4.0 启用模块 ./filebeat modules list ./filebeat modules enable Nginx ./filebeat modules list2、修改
1、7.4.0 启用模块
./filebeat modules list
./filebeat modules enable Nginx
./filebeat modules list
2、修改 modules.d/nginx.yml ,主要添加日志对应地址
[elasticsearch@es1 filebeat-7.4.0-linux-x86_64]$ cat modules.d/nginx.yml
# Module: nginx
# Docs: https://www.elastic.co/guide/en/beats/filebeat/7.4/filebeat-module-nginx.html
- module: nginx
# Access logs
access:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["/usr/local/nginx/logs/access.log*"]
# Error logs
error:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["/usr/local/nginx/logs/error.log"]
3、配置filebeat配置文件
[elasticsearch@es1 filebeat-7.4.0-linux-x86_64]$ cat nginx-m.yml
filebeat.inputs:
#- type: log
# enabled: true
# paths:
# - /usr/local/nginx/logs/*.log
# tags: ["nginx"]
setup.template.settings:
index.number_of_shards: 2
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["192.168.56.101:9200"]
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
[elasticsearch@es1 filebeat-7.4.0-linux-x86_64]$
4、启动
./filebeat -e -c nginx-m.yml
5、访问并观察数据
--结束END--
本文标题: filebeat nginx 日志处理配置
本文链接: https://www.lsjlt.com/news/52839.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-09
2024-05-09
2024-05-09
2024-05-09
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0