`
wensong
  • 浏览: 125367 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

关于统计log

阅读更多

写个脚本统计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 ";

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics