当前位置:网站首页>大规模服务异常日志检索
大规模服务异常日志检索
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 编写的脚本程序。
边栏推荐
- Great Wall Securities security does not open a securities account
- [acwing] 58 weeks 4489 Longest subsequence
- 安信证券手机版下载 网上开户安全吗
- 公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
- 被PMP考试“折磨”出来的考试心得,值得你一览
- 【测试开发】软件测试——基础篇
- 建筑建材行业经销商协同系统解决方案:赋能企业构建核心竞争力
- leetcode:421. 数组中两个数的最大异或值
- 电子元器件B2B商城系统开发:赋能企业构建进销存标准化流程实例
- NFT流动性市场安全问题频发—NFT交易平台Quixotic被黑事件分析
猜你喜欢
VSCode修改缩进不成功,一保存就缩进四个空格
Kunming Third Ring Road Closure project will pass through these places. Is there one near your home?
【HCIA持续更新】广域网技术
昆明三环闭合工程将经过这些地方,有在你家附近的吗?
离线、开源版的 Notion—— 笔记软件Anytype 综合评测
建筑建材行业经销商协同系统解决方案:赋能企业构建核心竞争力
周大福践行「百周年承诺」,真诚服务推动绿色环保
Understand ThreadLocal in one picture
What is low code development?
Using win10 scheduling task program to automatically run jar package at fixed time
随机推荐
51 single chip microcomputer temperature alarm based on WiFi control
TP configuring multiple databases
解决el-input输入框.number数字输入问题,去掉type=“number“后面箭头问题也可以用这种方法代替
DataKit——真正的统一可观测性 Agent
Is it safe for Anxin securities to open an account online? Is the account opening fee charged
ECCV 2022 released: 1629 papers were selected, and the employment rate was less than 20%
tx.origin安全问题总结
矿产行业商业供应链协同系统解决方案:构建数智化供应链平台,保障矿产资源安全供应
ble HCI 流控机制
Readis configuration and optimization of NoSQL (final chapter)
[glide] cache implementation - memory and disk cache
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
Firewall basic transparent mode deployment and dual machine hot standby
2022PMP考试基本情况详情了解
防火墙基础透明模式部署和双机热备
Datakit -- the real unified observability agent
R语言plotly可视化:plotly可视化多分类变量小提琴图(multiple variable violin plot in R with plotly)
第十八届IET交直流输电国际会议(ACDC2022)于线上成功举办
What are cache penetration, cache breakdown, and cache avalanche
手里10万元存款买什么理财产品收益最高?