awk日志分割
awk日志分割
1. awk实现日志按照日期分割
#!/bin/bash
DATE=$(date -d yesterday +%Y-%m-%d)
awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' pay-front.log.$DATE >> pay-front.error.log.$DATE
###参考http://blog.51yip.com/shell/1151.html
###改进例子
##awk '/^2017-05-22/, $1=="2017-05-" {print}' businessUser.log |awk 'BEGIN{RS="2017-05-22"} /'ERROR'|'OutOfMemory'/ {print RS,$0 }'
脚本如下:
#!/bin/bash
#1.将备份在/sumafile/log/backup的日志拷贝到/sumafile/log/Log_segmentation目录下并解压业务日志和删除domain日志
set -x
###每周日删除过滤日志的日志信息
if [[ `date | awk '{print $4}'` == "星期日" ]]; then
rm -rf /sumafile/log/shscript/Log_segmentation.log
fi
##1.1配置环境变量
DATE=$(date -d yesterday "+%Y-%m-%d")
DATE_TODAY=$(date "+%Y-%m-%d")
##1.2拷贝备份日志文件到/sumafile/log/Log_segmentation/$DATE目录下
cp -rf /sumafile/log/backup/$DATE /sumafile/log/Log_segmentation/$DATE
##1.3删除domain日志
###1.3.1删除网关组domain日志及其httpd日志
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw1/glassfishlog
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw1/httplog
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw2/glassfishlog
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw2/httplog
###1.3.2删除平台组domain日志
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-app1/glassfishlog
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-app2/glassfishlog
###1.3.3删除业务组domain日志
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz1/glassfishlog
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz2/glassfishlog
###1.3.4删除核心组domain日志
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core1/glassfishlog
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core2/glassfishlog
###1.3.5删除对账组domain日志
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-bdb1/glassfishlog
###1.3.6删除运营组domain日志
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-ope/glassfishlog
###1.3.7删除调度组domain日志
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-sch/glassfishlog
###1.3.8删除连接器组domain日志
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/glassfishlog
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/glassfishlog
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/glassfishlog
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con27/glassfishlog
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con29/glassfishlog
##1.4解压转移业务日志并删除压缩文件
###1.4.1网关组
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-gw1/sumapaylog/${DATE}_idca-gw1_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-gw1/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-gw1/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-gw1/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw1/sumapaylog/
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-gw2/sumapaylog/${DATE}_idca-gw2_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-gw2/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-gw2/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-gw2/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw2/sumapaylog/
###1.4.2平台组
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-app1/sumapaylog/${DATE}_idca-app1_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-app1/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-app1/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-app1/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-app1/sumapaylog/
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-app2/sumapaylog/${DATE}_idca-app2_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-app2/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-app2/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-app2/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-app2/sumapaylog/
###1.4.3业务组
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-biz1/sumapaylog/${DATE}_idca-biz1_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-biz1/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-biz1/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-biz1/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz1/sumapaylog/
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-biz2/sumapaylog/${DATE}_idca-biz2_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-biz2/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-biz2/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-biz2/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz2/sumapaylog/
###1.4.4核心服务器组
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-core1/sumapaylog/${DATE}_idca-core1_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-core1/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-core1/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-core1/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core1/sumapaylog/
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-core2/sumapaylog/${DATE}_idca-core2_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-core2/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-core2/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-core2/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core2/sumapaylog/
###1.4.5对账服务组
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-bdb1/sumapaylog/${DATE}_idca-bdb1_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-bdb1/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-bdb1/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-bdb1/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-bdb1/sumapaylog/
###1.4.6运营组
#tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-ope/sumapaylog/${DATE}_idca-ope_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-ope/sumapaylog/
#mv /sumafile/log/Log_segmentation/$DATE/idca-ope/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-ope/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-ope/sumapaylog/
###1.4.7调度组
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-sch/sumapaylog/${DATE}_idca-sch_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-sch/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-sch/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-sch/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-sch/sumapaylog/
###1.4.8连接器组
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-con21/sumapaylog/${DATE}_idca-con21_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-con21/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-con21/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-con21/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/sumapaylog/
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-con22/sumapaylog/${DATE}_idca-con22_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-con22/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-con22/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-con22/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/sumapaylog/
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-con23/sumapaylog/${DATE}_idca-con23_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-con23/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-con23/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-con23/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/sumapaylog/
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-con27/sumapaylog/${DATE}_idca-con27_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-con27/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-con27/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-con27/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con27/sumapaylog/
tar -zxvf /sumafile/log/Log_segmentation/$DATE/idca-con29/sumapaylog/${DATE}_idca-con29_sumapaylog.tar.gz -C /sumafile/log/Log_segmentation/$DATE/idca-con29/sumapaylog/
mv /sumafile/log/Log_segmentation/$DATE/idca-con29/sumapaylog/log/* /sumafile/log/Log_segmentation/$DATE/idca-con29/
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con29/sumapaylog/
##1.5过滤日志并删除原日志
###1.5.1网关组
####1.5.1.1 ica-gw1
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-gw1/businessUser.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-gw1/businessUser.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw1/businessUser.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-gw1/hsbapi.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-gw1/hsbapi.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw1/hsbapi.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-gw1/merchant.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-gw1/merchant.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw1/merchant.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-gw1/website.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-gw1/website.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw1/website.log.${DATE}
####1.5.1.2 idca-gw2
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-gw2/businessUser.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-gw2/businessUser.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw2/businessUser.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-gw2/hsbapi.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-gw2/hsbapi.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw2/hsbapi.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-gw2/merchant.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-gw2/merchant.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw2/merchant.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-gw2/website.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-gw2/website.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-gw2/website.log.${DATE}
###1.5.2平台组
####1.5.2.1 idca-app1
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-app1/finance/finance.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-app1/finance/finance.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-app1/finance/finance.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-app1/front/pay-front.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-app1/front/pay-front.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-app1/front/pay-front.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-app1/front/pay-front-record.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-app1/front/pay-front-record.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-app1/front/pay-front-record.log.${DATE}
####1.5.2.2 idca-app2
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-app2/finance/finance.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-app2/finance/finance.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-app2/finance/finance.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-app2/front/pay-front.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-app2/front/pay-front.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-app2/front/pay-front.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-app2/front/pay-front-record.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-app2/front/pay-front-record.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-app2/front/pay-front-record.log.${DATE}
###1.5.3业务组
####1.5.3.1 idca-biz1
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz1/biz/disburse-front-record.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz1/biz/disburse-front-record.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz1/biz/disburse-front-record.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz1/biz/pay-front-record.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz1/biz/pay-front-record.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz1/biz/pay-front-record.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz1/biz/withholding.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz1/biz/withholding.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz1/biz/withholding.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz1/disburse/disburse.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz1/disburse/disburse.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz1/disburse/disburse.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz1/hsbdepository/hsbdepository.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz1/hsbdepository/hsbdepository.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz1/hsbdepository/hsbdepository.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz1/pay/pay.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz1/pay/pay.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz1/pay/pay.log.${DATE}
####1.5.3.2 idca-biz2
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz2/biz/disburse-front-record.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz2/biz/disburse-front-record.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz2/biz/disburse-front-record.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz2/biz/pay-front-record.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz2/biz/pay-front-record.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz2/biz/pay-front-record.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz2/biz/withholding.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz2/biz/withholding.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz2/biz/withholding.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz2/disburse/disburse.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz2/disburse/disburse.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz2/disburse/disburse.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz2/hsbdepository/hsbdepository.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz2/hsbdepository/hsbdepository.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz2/hsbdepository/hsbdepository.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-biz2/pay/pay.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-biz2/pay/pay.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-biz2/pay/pay.log.${DATE}
###1.5.4核心组
####1.5.4.1 idca-core1
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-core1/deadmessage/deadmessage.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-core1/deadmessage/deadmessage.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core1/deadmessage/deadmessage.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-core1/finance/finance.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-core1/finance/finance.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core1/finance/finance.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-core1/merchantNotice/merchantNotice.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-core1/merchantNotice/merchantNotice.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core1/merchantNotice/merchantNotice.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-core1/mq/mq_group_minitor.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-core1/mq/mq_group_minitor.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core1/mq/mq_group_minitor.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-core1/platform/merchant.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-core1/platform/merchant.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core1/platform/merchant.log.${DATE}
####1.5.4.2 idca-core2
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-core2/finance/finance.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-core2/finance/finance.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core2/finance/finance.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-core2/merchantNotice/merchantNotice.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-core2/merchantNotice/merchantNotice.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core2/merchantNotice/merchantNotice.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-core2/platform/merchant.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-core2/platform/merchant.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-core2/platform/merchant.log.${DATE}
###1.5.5对账组
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-bdb1/finance/bankcheck.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-bdb1/finance/bankcheck.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-bdb1/finance/bankcheck.log
###1.5.6调度组
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-sch/schedual.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-sch/schedual.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-sch/schedual.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-sch/schedual/control.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-sch/schedual/control.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-sch/schedual/control.log
###1.5.7运营组
###1.5.8连接器组
####1.5.8.1 idca-con21
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/pay_sms.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/pay_sms.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/pay_sms.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cdms_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cdms_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cdms_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cfca.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cfca.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cfca.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cfcap_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cfcap_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cfcap_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cfca_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cfca_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cfca_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cmbbank.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cmbbank.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cmbbank.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cmsbbank.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cmsbbank.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cmsbbank.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cmsb_unionpay.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cmsb_unionpay.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/cmsb_unionpay.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/hfb2_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/hfb2_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/hfb2_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/icbc_disburse.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/icbc_disburse.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/icbc_disburse.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/nyfd_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/nyfd_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/nyfd_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/nyf_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/nyf_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/nyf_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/pab_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/pab_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/pab_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/sft3.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/sft3.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/sft3.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/smsw.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/smsw.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/smsw.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/szicbc.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/szicbc.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/szicbc.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/szyl.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/szyl.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/szyl.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/umb.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/umb.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/umb.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/ysb_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/ysb_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/ysb_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/yzf_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/yzf_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/yzf_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/ysepay_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/ysepay_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con21/connector/ysepay_withholding.connector.log
####1.5.8.2 idca-con22
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/pay_sms.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/pay_sms.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/pay_sms.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cdms_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cdms_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cdms_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cfca.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cfca.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cfca.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cfcap_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cfcap_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cfcap_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cfca_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cfca_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cfca_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cmbbank.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cmbbank.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cmbbank.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cmsbbank.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cmsbbank.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cmsbbank.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cmsb_unionpay.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cmsb_unionpay.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/cmsb_unionpay.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/hfb2_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/hfb2_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/hfb2_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/icbc_disburse.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/icbc_disburse.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/icbc_disburse.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/nyfd_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/nyfd_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/nyfd_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/nyf_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/nyf_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/nyf_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/pab_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/pab_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/pab_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/sft3.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/sft3.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/sft3.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/smsw.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/smsw.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/smsw.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/szicbc.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/szicbc.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/szicbc.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/szyl.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/szyl.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/szyl.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/umb.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/umb.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/umb.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/ysb_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/ysb_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/ysb_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/hxbbank.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/hxbbank.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/hxbbank.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/ysepay_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/ysepay_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/ysepay_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/sft2.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/sft2.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con22/connector/sft2.connector.log
####1.5.8.3 idca-con23
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/pay_sms.log.${DATE} | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/pay_sms.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/pay_sms.log.${DATE}
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cdms_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cdms_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cdms_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cfca.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cfca.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cfca.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cfcap_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cfcap_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cfcap_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cfca_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cfca_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cfca_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cmbbank.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cmbbank.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cmbbank.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cmsbbank.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cmsbbank.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cmsbbank.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cmsb_unionpay.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cmsb_unionpay.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cmsb_unionpay.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/hfb2_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/hfb2_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/hfb2_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/icbc_disburse.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/icbc_disburse.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/icbc_disburse.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/nyfd_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/nyfd_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/nyfd_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/nyf_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/nyf_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/nyf_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/pab_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/pab_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/pab_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/sft3.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/sft3.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/sft3.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/smsw.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/smsw.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/smsw.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/szicbc.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/szicbc.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/szicbc.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/szyl.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/szyl.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/szyl.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/umb.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/umb.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/umb.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/ysb_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/ysb_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/ysb_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/yzf_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/yzf_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/yzf_withholding.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cgbbank.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cgbbank.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cgbbank.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cebbank.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cebbank.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/cebbank.connector.log
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/ysepay_withholding.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/ysepay_withholding.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con23/connector/ysepay_withholding.connector.log
#####1.5.8.4 idca-con29
awk '/^'$DATE'/, $1=="'$DATE_TODAY'" {print }' /sumafile/log/Log_segmentation/$DATE/idca-con29/connector/xmmsfastpay.connector.log | awk 'BEGIN{RS="'$DATE'"} /'ERROR'|'OutOfMemory'/ { print RS, $0}' >> /sumafile/log/Log_segmentation/$DATE/idca-con29/connector/xmmsfastpay.connector.error.log.${DATE}
rm -rf /sumafile/log/Log_segmentation/$DATE/idca-con29/connector/xmmsfastpay.connector.log
##1.6压缩文件
cd /sumafile/log/Log_segmentation/$DATE/
zip -r /sumafile/log/temp-analyzer/analyzer-error-log-${DATE}.zip ./*
rm -rf /sumafile/log/Log_segmentation/${DATE}/
awk日志分割的更多相关文章
- Linux日志分割脚本
该脚本的功能是定时分割日志文件 #!/usr/bin/env bash #定时分割清理日志文件 #usage="Usage: logrotate (start|stop) file (lin ...
- nginx 直接在配置文章中设置日志分割
直接在nginx配置文件中,配置日志循环,而不需使用logrotate或配置cron任务.需要使用到$time_iso8601 内嵌变量来获取时间.$time_iso8601格式如下:2015-08- ...
- apache2.4配置访问日志分割并过滤图片CSS等无用内容
相关信息 1.apache日志有访问日志和错误日志,错误日志根据日志级别来输出错误信息,而访问日志根据定义的日志格式来记录访问动作 2.访问日志格式在httpd.conf文件里面定义,在虚拟主机里面引 ...
- Nginx常用日志分割方法
方式一: nginx cronolog日志分割配置文档,根据下面方法,每分钟分割一次NGINX访问日志. 1.nginx日志配置 access_log /var/log/nginx/access.lo ...
- python 跨模块实现按照文件大小,日期实现日志分割,反转
笔者的一个自动化测试平台项目,采用了python作为后端服务器语言.项目基于快速成型目的,写了一个极其简陋的日志记录功能,支持日志记录到文件和支持根据日志级别在终端打印不同颜色的log.但随着测试平台 ...
- Nginx高性能服务器安装、配置、运维 (6) —— Nginx日志及日志分割
七.Nginx日志及日志分割 (1)Nginx日志文件 查看Nginx配置文件: 找到access_log,yum安装默认存储在/var/log/nginx目录下,且默认main格式: main格式定 ...
- Apache日志分割
1.cronolog安装 采用 cronolog 工具进行 apache 日志分割 http://download.chinaunix.net/download.php?id=3457&Res ...
- nginx 日志分割(简单、全面)
Nginx 日志分割 因业务需要做了简单的Nginx 日志分割, 第1章 详细配置如下. #建议在mkdir /home/shell -p 专门写shell 脚本位置 root@localhost ...
- Tomcat 的 catalina.out 日志分割
一.背景 Tomcat 的 catalina.out 日志量不断增加,占用空间较大,且默认是不滚动的.因此,需要对其进行日志分割,并进行清理. 本文选用 Cronolog 对其进行分割. 二.安装 1 ...
随机推荐
- linux命令行挂载NTFS文件系统的移动硬盘
环境 ubuntu 12.04 桌面版 由于我的ubuntu 是安装在vmware 上,如果接入移动硬盘后,它没有办法自动识别ntfs 格式的文件系统,导致mount 盘失败 从网上找到一个方法 首先 ...
- 几例实用的Shell脚本
日常工作中,经常编写一些shell命令或脚本以完成重复性操作,本文分享了最近用到的几例shell实用脚本. 1 特殊文件名的远程拷贝 服务器之间拷贝文件经常使用scp命令,其命令格式: (1)scp ...
- Codeforces Round #541 (Div. 2) B.Draw!
链接:https://codeforces.com/contest/1131/problem/B 题意: 给n次足球比分,求存在平局的机会. 思路: 结构体存储,unique后,判断是否有分数交叉. ...
- wireshark工具集
tshark 查看pcap文件第一个包的时间,当文件名不包含时间信息时非常有帮助 tshark -c 1 -T fields -e frame.time -r test.pcap dumpcap ed ...
- IDEA自定义设置快捷键输出你想要的语句!
转载,侵权必删 用Eclipse时间长了, 就习惯之前的快捷键! 当然, IDEA不愧是Java开发的”利器”! 写起代码就是一个字 – “爽”! 建议大家可以去尝试一下! 当然, 在IDEA中输出S ...
- SpringBoot实现登陆拦截
一.创建interceptor包,在interceptor中创建一个拦截器并实现HandlerInterceptor 代码: @Componentpublic class LoginHandlerIn ...
- _CrtDumpMemoryLeaks()的作用 检测内存泄漏
_CrtDumpMemoryLeaks()的作用 2007-03-22 10:11 CrtDumpMemoryLeaks()就是显示当前的内存泄漏. 注意是“当前”, 也就是说当它执行 ...
- 《Python基础教程》 读书笔记 第九章 魔法方法、属性和迭代器(上)
构造方法 在Python中创建一个构造方法很容易.只要把init方法的名字从简单的init修改为魔法版本__init__即可: >>> class FooBar: ... d ...
- rm和mv和dirname和查看文件的命令
rm -f -i -r ############################ mv -f -i -u 比较新旧 ########################### basename 获取文 ...
- vector容器类型
vector容器是一个模板类,可以存放任何类型的对象(但必须是同一类对象).vector对象可以在运行时高效地添加元素,并且vector中元素是连续存储的. vector的构造 函数原型: tem ...