#!/bin/sh datetime=$1 if [ "$datetime"x = "x" ];then datetime=`date +"%Y%m%d%H" -d "-1hour"` datetime="2017012100" fi mkdir logs mkdir tmp mkdir result echo $datetime ifind -s theone-dist-stg > output.log irun -c 'grep broad /home/xiaoju/strategy_service/log/public.log.'${datetime}'|grep "area=4|"|awk -F"\\\|\\\|" "{print \$1,\$3,\$4,\$8,\$9,\$11,\$12,\$96,\$97}"' | grep -v "theone" > ./logs/log.$datetime cat ./logs/log.$datetime | awk "{print \$7}" | awk -F'=' '{print $NF}' | sort | uniq > ./tmp/driver.$datetime #irun -c 'grep broad /home/xiaoju/strategy_service/log/public.log.'${datetime}'|grep "area=2|"|awk -F"\\\|\\\|" "{print \$4}"' | grep -v "theone" | awk -F'=' '{print $2}' | sort | uniq > driver.$datetime cat ./tmp/driver.$datetime > ./tmp/tmp cat ./shenzheng_ids >> ./tmp/tmp cat ./tmp/tmp | sort | uniq -c | grep "2 " | awk '{print $NF}' > ./tmp/result.$datetime while read line do echo $line #这里可根据实际用途变化 cat ./logs/log.$datetime | grep "$line" >> ./result/result.$datetime #irun -c 'grep broad /home/xiaoju/strategy_service/log/public.log.'${datetime}'|grep "area=2|"|awk -F"\\\|\\\|" "{print \$4}"' | grep -v "theone" | awk -F'=' '{print $2}' | sort | uniq > driver.$datetime done < ./tmp/result.$datetime
test
最新推荐文章于 2022-12-05 16:09:13 发布