码迷,mamicode.com
首页 > 其他好文 > 详细

PV、UV、独立 IP的统计

时间:2016-06-29 15:58:51      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:pv、uv、独立 ip的统计

[root@ Statistic]# cat Statistic.sh 

#!/bin/bash 

Date=$(date  -d "+1 day ago" +%F )

Path=/app/logs/

echo $Date 

echo "=============================================="

echo "login user info"

echo "Frequency   UserName"

grep userName ${Path}catalina.out | grep `date  -d "+1 day ago"  +%m-%d` |awk -F ": "  ‘{print $2}‘ | awk -F "]"  ‘{print $1}‘ | awk -F "userName=" ‘{print $2}‘ | awk -F [ ‘{print $2}‘ |sort  |uniq -c |sort -nr -k 1 

#echo "Frequency   UserName "

#grep userName /logs/app.log.2016-`date  -d "+1 day ago"  +%m-%d` |awk -F userName=  ‘{print $2}‘ | awk -F ] ‘{print $1}‘ | awk -F [ ‘{print $2}‘  |sort |uniq -c |sort -nr -k 1

echo "=============================================="

echo "                                              "

echo "PV"

grep "GET / HTTP" ${Path}localhost_access_log.${Date}.txt  |wc -l

echo "=============================================="

echo "                                              "

echo "UV"

grep "GET / HTTP" ${Path}localhost_access_log.${Date}.txt | awk ‘{print $1}‘ | sort |uniq -c | wc -l

echo "=============================================="

echo "                                              "

echo "IP "

awk ‘{print $1}‘  ${Path}localhost_access_log.${Date}.txt |sort |uniq -c | wc -l


PV、UV、独立 IP的统计

标签:pv、uv、独立 ip的统计

原文地址:http://wangqh.blog.51cto.com/5367393/1794176

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!