怎么写一个shelll脚本,执行筛选每天生成的日志?
之前提取日志,都是拼命令,而且学习linux也不久,不会高深的脚本,求大神给点具体框架提示。
之前的命令大多这样:
1、grep -oh ' - [0-9]\+|' matach.log.2015-05-2[5-9] matach.log.2015-05-3[0-1]|cut -b 4-14|awk '{print substr($1,0,7),$1}'|sort -t' ' -k1 > matach.txt
2、join -1 4 -2 1 ssxhaoduan matach.txt > matach.end.txt
3、awk '{print $4}' matach.end.txt|sort|uniq -c
都是一步一步敲的,筛选出日志内需要的内容再具体统计,现在想写个脚本让他自动执行筛选每天内容并统计