- 搜索按照多个条件搜索,查找某个时间段的日志
sed -n '/2020-07-09 18:00:00/, /2020-07-09 23:59:59:/p' service.odds.basicsingle.getSingleSevice2Odds.log.2020-07-09 | grep ep '"code":-7' | grep 'page=1&trnum=30&companytype=BaijiaBooks&type=0'
2.查找某个时间段的日志,并且统计符合条件的数据个数
sed -n '/2020-07-09 18:00:00/, /2020-07-09 23:59:59:/p' service.odds.basicsingle.getSingleSevice2Odds.log.2020-07-09 | grep -c '"code":-7'
- 搜索按照多个条件搜索,查找某个时间段的日志的统计数据条数
sed -n '/2020-07-09 18:00:00/, /2020-07-09 23:59:59:/p' service.odds.basicsingle.getSingleSevice2Odds.log.2020-07-09 | grep '"code":-28' | grep 'page=1&trnum=30&companytype=BaijiaBooks&type=0'| wc -l
4.某个时间点的日志搜索
grep '2020-07-09 23:57:44' service.odds.basicsingle.getSingleSevice2Odds.log.2020-07-09 | grep '2742575'
网友评论