網(wǎng)站首頁 編程語言 正文
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是否產(chǎn)生error索引
已經(jīng)生成
3.在kibana上關(guān)聯(lián)es索引
點(diǎn)擊Managerment---索引模式---創(chuàng)建索引
創(chuàng)建成功
4.在kibana上統(tǒng)計錯誤日志
點(diǎn)擊Discovery---選擇索引即可查看,根據(jù)自己的需求進(jìn)行統(tǒng)計即可
原文鏈接:https://juejin.cn/post/7134503277395181575
相關(guān)推薦
- 2023-07-04 Spring中@Transactional注解事務(wù)傳播行為propagation參數(shù)說明
- 2022-06-29 Python利用pynput實現(xiàn)劃詞復(fù)制功能_python
- 2022-05-17 Spring Cloud OpenFeign源碼解析
- 2021-11-29 c++11?chrono全面解析(最高可達(dá)納秒級別的精度)_C 語言
- 2022-04-07 Go語言中的Base64編碼原理介紹以及使用_Golang
- 2022-06-25 C#將DataGridView中的數(shù)據(jù)保存到CSV和Excel中_C#教程
- 2022-07-10 CSS解決未知高度垂直居中
- 2022-07-03 Golang之函數(shù)選項模式
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支