PVUV独立 IP的统计
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PVUV独立 IP的统计相关的知识,希望对你有一定的参考价值。
[[email protected] 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
以上是关于PVUV独立 IP的统计的主要内容,如果未能解决你的问题,请参考以下文章
Flume+Kafka+Storm+Redis构建大数据实时处理系统:实时统计网站PVUV+展示
FLINK 基于1.15.2的Java开发-使用AggregateFunction解决以天为单位诸如PVUV等统计的实时计算