如何根据tomcat日志计算PV,ip,PU?
我已将 tomcat 日志导出到数据库。
可以在此处找到有关 db 结构的信息。
对于我可以使用的ip:
select count(distinct ip)...
但是pv和pu呢?
我不知道,如果你知道,请帮我一个忙。
如何根据tomcat日志计算PV,ip,PU?
我已将 tomcat 日志导出到数据库。
可以在此处找到有关 db 结构的信息。
对于我可以使用的ip:
select count(distinct ip)...
但是pv和pu呢?
我不知道,如果你知道,请帮我一个忙。
就像是
SELECT
COUNT(SELECT DISTINCT ip from tblName) AS IPs,
COUNT(SELECT DISTINCT uri from tblName) AS UniquePages,
COUNT(SELECT DISTINCT username from tblName) as UniqueVisitors from tblName;
应该为你工作
要限制应计算的页面类型,请将其添加到子查询中
SELECT
COUNT(SELECT DISTINCT ip from tblName) AS IPs,
COUNT(SELECT DISTINCT uri from tblName WHERE uri NOT LIKE '%.js' AND uri NOT LIKE '.css') AS UniquePages,
COUNT(SELECT DISTINCT username from tblName) as UniqueVisitors from tblName;