统计云MAS平台日志当天发送情况
样本数据:
2023-05-04 00:09:00,597 INFO [Thread-1738] cid[1] send Submit: sequence_id = 1661023,dest_terminal_id[0] = 1300000021
2023-05-04 00:09:00,606 INFO [Thread-1737] cid[1] get SubmitResponse sequence_id = 1661017,msg_id = 5908881041440468738,result = 0
2023-05-04 00:09:05,252 INFO [Thread-4] cid[1] get Deliver(REPORT) msg_id = 5908881041440468739, src_terminal_id = 1300001320, status = DELIVRD
2023-05-04 00:06:17,626 INFO [Thread-1737] cid[1] get SubmitResponse sequence_id = 1660848,msg_id = 590883238805093658,result = 8
统计当天客户每秒发送速率
zgrep “send Submit:” sender01.log.2023-05-04|awk -F “,” ‘{shell[KaTeX parse error: Expected 'EOF', got '}' at position 5: 1]++}̲END{for(i in sh…NF]++}END{for (i in shell) {print i,shell[i]}}’
统计除DELIVRD外回执数量大于1500的状态报告是什么?并输出该回执数量
cat sender01.log.2023-05-04 |grep “status”|grep -v " DELIVRD"|awk -F “=” ‘{shell[$NF]++}END{for (i in shell) {if(shell[i]>1500)print i,shell[i]}}’
统计2023-05-04 21:06:42提交条数
zgrep “send Submit:” sender01.log.2023-05-04|awk ‘/^2023-05-04 21:06:42/,/^2023-05-04 21:06:42/{print $0}’|wc -l
统计超速条数
zgrep “result = 8” sender01.log.2023-05-04