这篇文章主要为大家介绍了filebeat同时收集错误日志与普通日志并存详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
1.配置filebeat收集error日志
只收集正常日志往往是不完整的,错误日志更需要收集起来
所有集群都按如下配置,其实就是增加了一个type和一个index
vim /etc/filebeat/filebeat.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/nginx/www_access.log
json.keys_under_root: true
json.overwrite_keys: true
tags: ["www"]
- type: log
enabled: true
paths:
- /var/log/nginx/bbs_access.log
json.keys_under_root: true
json.overwrite_keys: true
tags: ["bbs"]
- type: log
enabled: true
paths:
- /var/log/nginx/blog_access.log
json.keys_under_root: true
json.overwrite_keys: true
tags: ["blog"]
- type: log
enabled: true
paths:
- /var/log/nginx/error.log
tags: ["error"]
output.elasticsearch:
hosts: ["192.168.81.210:9200"]
indices:
- index: "nginx-www-access-%{+yyyy.MM.dd}"
when.contains:
tags: "www"
- index: "nginx-bbs-access-%{+yyyy.MM.dd}"
when.contains:
tags: "bbs"
- index: "nginx-blog-access-%{+yyyy.MM.dd}"
when.contains:
tags: "blog"
- index: "nginx-error-%{+yyyy.MM.dd}"
when.contains:
tags: "error"
systemctl restart filebeat
2.查看es是否产生error索引
已经生成
3.在kibana上关联es索引
点击Managerment---索引模式---创建索引
创建成功
4.在kibana上统计错误日志
点击Discovery---选择索引即可查看,根据自己的需求进行统计即可
以上就是filebeat同时收集错误日志与普通日志并存详解的详细内容,更多关于filebeat错误普通日志并存的资料请关注编程学习网其它相关文章!
沃梦达教程
本文标题为:filebeat同时收集错误日志与普通日志并存详解


猜你喜欢
- CentOS_mini下安装docker 之 安装docker CE 2023-09-23
- CentOS7安装GlusterFS集群的全过程 2022-10-10
- 【转载】CentOS安装Tomcat 2023-09-24
- 教你在docker 中搭建 PHP8 + Apache 环境的过程 2022-10-06
- nginx中封禁ip和允许内网ip访问的实现示例 2022-09-23
- KVM虚拟化Linux Bridge环境部署的方法步骤 2023-07-11
- 阿里云ECS排查CPU数据分析 2022-10-06
- IIS搭建ftp服务器的详细教程 2022-11-15
- 解决:apache24 安装后闪退和配置端口映射和连接超时设置 2023-09-11
- 利用Docker 运行 python 简单程序 2022-10-16