写个脚本统计log
day=$1;
type=$2;
typefile="/data/wens/sharefile/type";
for type in `cat $typefile`
do
searchKey="type:$type,";
echo "type:$type";
if [ "$type" == "" ]; then
searchKey="INFO";
fi
catfile="/data/xce/XwServiceUGC/log/share/share-create.log";
if [ "$day" != "" ]; then
catfile=${catfile}_${day};
fi
num=`ssh xce@10.3.22.167 "cat $catfile | grep $searchKey | wc -l"`
if [ "$day" == "" ];then
echo "截止 day:`date` - share type:$type - num:$num"
fi
if [ "$day" != "" ];then
echo "day:$day - share type:$type - num:$num"
fi
done;
num=`ssh xce@10.3.22.167 "cat $catfile | grep INFO | wc -l"`
echo "截止 `date` 今天IM分享总数为 $num ";