当前位置:网站首页>大规模服务异常日志检索
大规模服务异常日志检索
2022-07-04 15:42:00 【Wu_Candy】
[email protected] bin # more check_log.sh #检查一个目录下所有指定日志文件中的报错日志脚本
#!/usr/bin/env bash #是对shell的声明
base="/home/project" #定义一个变量,用于指定扫描日志的目录
while [[ 1 ]]; do #shell 中无限循环定义
for name in `ls $base | grep -vE "default"`; #for 循环开始遍历目录下的文件,过滤掉default目录
do #开始执行
echo base/name #输出目录路径
if [[ -d base/name ]]; then #判断是否是目录
result=`grep -C10 base/name/logs/catalina.out | grep -vE "DEBUG|skywalking|10.8.0.37:8800" | grep -C5 -E "Exception|ERROR"`
# 获取catalina.out 文件中报Exception|ERROR的日志,过滤掉DEBUG|skywalking|10.8.0.37:8800这三类信息
if [[ -z "
continue; #继续
fi #if 结束符
echo -e "\n\033[31mfind Exception in
fi #if 结束符
done #do 结束符
echo -e "sleep 60 seconds\n" #输出休息一分钟
sleep 60s #等待一分钟
done #do 结束符
Shell 是一个用 C 语言编写的程序,它是用户使用 Linux 的桥梁。Shell 既是一种命令语言,又是一种程序设计语言。
Shell 是指一种应用程序,这个应用程序提供了一个界面,用户通过这个界面访问操作系统内核的服务。
Shell 脚本(shell script),是一种为 shell 编写的脚本程序。
边栏推荐
- 【华为HCIA持续更新】SDN与FVC
- Perfectly integrated into win11 style, Microsoft's new onedrive client is the first to see
- VSCode修改缩进不成功,一保存就缩进四个空格
- Ble HCI flow control mechanism
- Developers, MySQL column finish, help you easily from installation to entry
- Which domestic cloud management platform manufacturer is good in 2022? Why?
- Is it safe to open an account online
- Blood spitting finishing nanny level series tutorial - play Fiddler bag grabbing tutorial (2) - first meet fiddler, let you have a rational understanding
- 中信证券网上开户安全吗 开户收费吗
- MD5加密的两种方式
猜你喜欢
PingCode 性能测试之负载测试实践
7 RSA密码体制
【HCIA持续更新】WLAN概述与基本概念
Perfectly integrated into win11 style, Microsoft's new onedrive client is the first to see
The 18th IET AC / DC transmission International Conference (acdc2022) was successfully held online
Smart Logistics Park supply chain management system solution: digital intelligent supply chain enables a new supply chain model for the logistics transportation industry
go-micro教程 — 第二章 go-micro v3 使用Gin、Etcd
Kunming Third Ring Road Closure project will pass through these places. Is there one near your home?
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
NFT liquidity market security issues occur frequently - Analysis of the black incident of NFT trading platform quixotic
随机推荐
关于nacos启动时防火墙开启8848的坑
Solution du système de gestion de la chaîne d'approvisionnement du parc logistique intelligent
leetcode刷题目录总结
[acwing] 58 weeks 4489 Longest subsequence
Perfectly integrated into win11 style, Microsoft's new onedrive client is the first to see
R语言plotly可视化:plotly可视化互相重叠的直方图(historgram)、并在直方图的顶部边缘使用geom_rug函数添加边缘轴须图Marginal rug plots
【云原生】服务网格是什么“格”?
Master the use of auto analyze in data warehouse
Unity interview questions (continuously updated)
《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(2)-初识Fiddler让你理性认识一下
Hidden corners of coder Edition: five things that developers hate most
Datakit -- the real unified observability agent
[glide] cache implementation - memory and disk cache
MVC模式和三层架构
KS007基于JSP实现人个人博客系统
Redis 的内存淘汰策略和过期删除策略的区别
How to choose one plus 10 pro and iPhone 13?
The winning rate against people is 84%, and deepmind AI has reached the level of human experts in army chess for the first time
第十八届IET交直流輸電國際會議(ACDC2022)於線上成功舉辦
安信证券手机版下载 网上开户安全吗