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是否產(chǎn)生error索引
已經(jīng)生成
3.在kibana上關(guān)聯(lián)es索引
點擊Managerment---索引模式---創(chuàng)建索引
創(chuàng)建成功
4.在kibana上統(tǒng)計錯誤日志
點擊Discovery---選擇索引即可查看,根據(jù)自己的需求進(jìn)行統(tǒng)計即可
以上就是filebeat同時收集錯誤日志與普通日志并存詳解的詳細(xì)內(nèi)容,更多關(guān)于filebeat錯誤普通日志并存的資料請關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
由于Nginx配置文件問題導(dǎo)致打不開網(wǎng)站unknown directive的解決
這篇文章主要介紹了由于Nginx配置文件問題導(dǎo)致打不開網(wǎng)站unknown directive,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-06-06Nginx 請求壓縮的實現(xiàn)(動態(tài)壓縮,靜態(tài)壓縮)
本文主要介紹了Nginx 請求壓縮的實現(xiàn)(動態(tài)壓縮,靜態(tài)壓縮),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2023-03-03使用nginx同域名下部署多個vue項目并使用反向代理的方法
這篇文章主要介紹了使用nginx同域名下部署多個vue項目并使用反向代理的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2019-02-02nginx+tomcat實現(xiàn)負(fù)載均衡,使用redis session共享
這篇文章主要介紹了nginx tomcat負(fù)載均衡 使用redis session共享,有興趣的同學(xué)可以了解一下。2016-12-12PHP(FastCGI)在Nginx的alias下出現(xiàn)404錯誤的解決方法
這篇文章主要介紹了PHP(FastCGI)在Nginx的alias下出現(xiàn)404錯誤的解決方法,涉及nginx平臺的相關(guān)配置技巧,需要的朋友可以參考下2016-05-05