1、查ip排行:grep "changeP" access_log_2015-08-17-10_00_00|grep -E '2015-08-17 10:(0[0-9]|1[0-5])' |awk '{print $2}'|sort|uniq -c|sort -rn|less
2、根据时间段、ip查询access_log_2015-11-04-10_00_00日志里链接为"/bid/changePrice.htm"的条数:
2、根据时间段、ip查询access_log_2015-11-04-10_00_00日志里链接为"/bid/changePrice.htm"的条数:
grep "/bid/changePrice.htm" access_log_2015-11-04-10_00_00|grep -E '10.24.48.71'|grep -E '2015-11-04 10:(0|[0,4])' |wc -l
3、查找/opt/jboss/domain/servers/ 路径下匹配'*/fserver*/*'目录里所有匹配'server.log.2015-11-09-*'文件中包含'ERROR'行数: find /opt/jboss/domain/servers/ -path '*/fserver*/*' -name 'server.log.2015-11-09-*'|xargs grep 'ERROR'|wc -l
3、查找/opt/jboss/domain/servers/ 路径下匹配'*/fserver*/*'目录里所有匹配'server.log.2015-11-09-*'文件中包含'ERROR'行数: find /opt/jboss/domain/servers/ -path '*/fserver*/*' -name 'server.log.2015-11-09-*'|xargs grep 'ERROR'|wc -l
find /opt/jboss/domain/servers/ -path '*/fserver*/*' -name 'server.log'|xargs grep 'connect timed out'|grep -E '2015-12-11 10:(0[0-9]|1[0-2])'|wc -l
find /opt/jboss/domain/servers/ -path '*/fserver*/*' -name 'server.log'|xargs grep 'JedisConnectionException'|grep -E '2015-12-11 10:(0[0-9]|1[0-2])'|wc -l
find /opt/jboss/domain/servers/ -path '*/fserver*/*' -name 'server.log'|xargs grep 'Read timed out'|grep -E '2015-12-11 10:(0[0-9]|1[0-2])'|wc -l
find /opt/jboss/domain/servers/ -path '*/fserver*/*' -name 'server.log'|xargs grep 'JedisConnectionException'|grep -E '2015-12-11 10:(0[0-9]|1[0-2])'|wc -l
find /opt/jboss/domain/servers/ -path '*/fserver*/*' -name 'server.log'|xargs grep 'Read timed out'|grep -E '2015-12-11 10:(0[0-9]|1[0-2])'|wc -l