当前位置:网站首页>Large scale service exception log retrieval
Large scale service exception log retrieval
2022-07-04 17:50:00 【Wu_ Candy】
[email protected] bin # more check_log.sh # Check the error reporting log script in all specified log files under a directory
#!/usr/bin/env bash # It's right shell Statement of
base="/home/project" # Define a variable , Used to specify the directory of the scan log
while [[ 1 ]]; do #shell Infinite loop definition
for name in `ls $base | grep -vE "default"`; #for The loop starts to traverse the files in the directory , To filter out default Catalog
do # Start execution
echo base/name # Output directory path
if [[ -d base/name ]]; then # Determine if it's a directory
result=`grep -C10 base/name/logs/catalina.out | grep -vE "DEBUG|skywalking|10.8.0.37:8800" | grep -C5 -E "Exception|ERROR"`
# obtain catalina.out Report in the document Exception|ERROR Log , To filter out DEBUG|skywalking|10.8.0.37:8800 These three types of information
if [[ -z "
continue; # continue
fi #if Terminator
echo -e "\n\033[31mfind Exception in
fi #if Terminator
done #do Terminator
echo -e "sleep 60 seconds\n" # Output rest for one minute
sleep 60s # Wait a minute
done #do Terminator
Shell It's a use. C A program written in a language , It is used by users Linux The bridge .Shell It's a command language , Another programming language .
Shell It's an application , This application provides an interface , Users access the services of the operating system kernel through this interface .
Shell Script (shell script), It's for shell Write the script .
边栏推荐
猜你喜欢
【HCIA持续更新】WLAN概述与基本概念
The 18th IET AC / DC transmission International Conference (acdc2022) was successfully held online
股价大跌、市值缩水,奈雪推出虚拟股票,深陷擦边球争议
Firewall basic transparent mode deployment and dual machine hot standby
To sort out messy header files, I use include what you use
Oppo Xiaobu launched Obert, a large pre training model, and promoted to the top of kgclue
Implementation of super large-scale warehouse clusters in large commercial banks
解读数据安全治理能力评估框架2.0,第四批DSG评估征集中
上市公司改名,科学还是玄学?
OPPO小布推出预训练大模型OBERT,晋升KgCLUE榜首
随机推荐
国产数据库TiDB初体验:简单易用,快速上手
[proteus simulation] printf debugging output example based on VSM serial port
【Hot100】32. Longest valid bracket
I2C子系统之适配器的设备接口分析(i2c-dev.c文件分析)
Cocoscreator event dispatch use
Implementation of super large-scale warehouse clusters in large commercial banks
7 RSA Cryptosystem
Pytorch深度学习之环境搭建
第十八届IET交直流輸電國際會議(ACDC2022)於線上成功舉辦
What grade does Anxin securities belong to? Is it safe to open an account
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
New technology releases a small program UNIPRO to meet customers' mobile office scenarios
Offline and open source version of notation -- comprehensive evaluation of note taking software anytype
新享科技发布小程序UniPro小优 满足客户移动办公场景
shell脚本的替换功能实现
为啥有些线上演唱会总是怪怪的?
【Hot100】32. 最长有效括号
补能的争议路线:快充会走向大一统吗?
【Hot100】31. 下一个排列
明星开店,退,退,退