網站首頁 編程語言 正文
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---選擇索引即可查看,根據自己的需求進行統計即可
原文鏈接:https://juejin.cn/post/7134503277395181575
- 上一篇:Qt實現計算器功能_C 語言
- 下一篇:Qt實現柵格布局效果_C 語言
相關推薦
- 2022-05-15 C++中類的轉換函數你了解嗎_C 語言
- 2022-10-07 Docker容器操作方法詳解_docker
- 2022-10-31 DatePicker日期滾動選擇使用詳解_Android
- 2023-01-15 SqlServer?多種分頁方式?詳解(含簡單速度測試)_MsSql
- 2022-04-17 Python?如何引入同級包和模塊_python
- 2022-04-27 Shell獲取路徑操作(dirname?$0?pwd)的實現_linux shell
- 2023-01-12 關于scipy.optimize函數使用及說明_python
- 2022-05-01 Qt實戰案例之如何利用QProcess類實現啟動進程_C 語言
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支