第2节 网站点击流项目(下):4、受访分析

2. 受访分析(从页面的角度分析)

select * from ods_click_pageviews limit 2;
+---------------------------------------+----------------------------------+----------------------------------+---------------------------------+------------------------------+---------------------------------+------------------------------------+----------------------------------------------------+----------------------------------------------------+--------------------------------------+-----------------------------+------------------------------+--+
| ods_click_pageviews.session | ods_click_pageviews.remote_addr | ods_click_pageviews.remote_user | ods_click_pageviews.time_local | ods_click_pageviews.request | ods_click_pageviews.visit_step | ods_click_pageviews.page_staylong | ods_click_pageviews.http_referer | ods_click_pageviews.http_user_agent | ods_click_pageviews.body_bytes_sent | ods_click_pageviews.status | ods_click_pageviews.datestr |
+---------------------------------------+----------------------------------+----------------------------------+---------------------------------+------------------------------+---------------------------------+------------------------------------+----------------------------------------------------+----------------------------------------------------+--------------------------------------+-----------------------------+------------------------------+--+
| 9ff03c4c-25f4-43fc-b3e0-08ea88b38fcc | 1.80.249.223 | - | 2013-09-18 07:57:33 | /hadoop-hive-intro/ | 1 | 60 | "http://www.google.com.hk/url?sa=t&rct=j&q=hive%E7%9A%84%E5%AE%89%E8%A3%85&source=web&cd=2&ved=0CC4QFjAB&url=%68%74%74%70%3a%2f%2f%62%6c%6f%67%2e%66%65%6e%73%2e%6d%65%2f%68%61%64%6f%6f%70%2d%68%69%76%65%2d%69%6e%74%72%6f%2f&ei=5lw5Uo-2NpGZiQfCwoG4BA&usg=AFQjCNF8EFxPuCMrm7CvqVgzcBUzrJZStQ&bvm=bv.52164340,d.aGc&cad=rjt" | "Mozilla/5.0(WindowsNT5.2;rv:23.0)Gecko/20100101Firefox/23.0" | 14764 | 200 | 20130918 |
| ba46b150-ca63-47d1-9cdd-e278df01f5d3 | 101.226.167.201 | - | 2013-09-18 09:30:36 | /hadoop-mahout-roadmap/ | 1 | 60 | "http://blog.fens.me/hadoop-mahout-roadmap/" | "Mozilla/4.0(compatible;MSIE8.0;WindowsNT6.1;Trident/4.0;SLCC2;.NETCLR2.0.50727;.NETCLR3.5.30729;.NETCLR3.0.30729;MediaCenterPC6.0;MDDR;.NET4.0C;.NET4.0E;.NETCLR1.1.4322;TabletPC2.0);360Spider" | 10335 | 200 | 20130918 |
+---------------------------------------+----------------------------------+----------------------------------+---------------------------------+------------------------------+---------------------------------+------------------------------------+----------------------------------------------------+----------------------------------------------------+--------------------------------------+-----------------------------+------------------------------+--+

--各页面访问统计
各页面PV:各个页面被访问了多少次

select request as request,count(1) as request_counts from
ods_weblog_detail group by request having request is not null order by request_counts desc limit 20;

-----------------------------------------------
--热门页面统计
统计20130918这个分区里面的受访页面的top10

drop table dw_hotpages_everyday;
create table dw_hotpages_everyday(day string,url string,pvs string);

insert into table dw_hotpages_everyday
select ‘20130918‘,a.request,a.request_counts from
(
select request as request,count(request) as request_counts
from ods_weblog_detail
where datestr=‘20130918‘
group by request
having request is not null
) a
order by a.request_counts desc limit 10;

统计每日最热门页面的top10
select a.month,a.day,a.request ,concat(a.month,a.day),a.total_request
from (
select month,day, request,count(1) as total_request
from ods_weblog_detail
where datestr = ‘20130918‘
group by request ,month ,day
having request is not null
order by total_request desc limit 10
) a;

原文地址:https://www.cnblogs.com/mediocreWorld/p/11107376.html

时间: 2024-07-29 11:47:06

第2节 网站点击流项目(下):4、受访分析的相关文章

第2节 网站点击流项目(下):2、明细宽表的生成

1. 本项目中数据仓库的设计 注:采用星型模型    1.1. 事实表设计 原始数据表: ods_weblog_origin =>对应mr清洗完之后的数据 valid string 是否有效 remote_addr string 访客ip remote_user string 访客用户信息 time_local string 请求时间 request string 请求url status string 响应码 body_bytes_sent string 响应字节数 http_referer

第2节 网站点击流项目(下):5、访客分析

-- 独立访客--需求:按照时间维度来统计独立访客及其产生的pv量 按照时间维度比如小时来统计独立访客及其产生的 pv . 时间维度:时drop table dw_user_dstc_ip_h;create table dw_user_dstc_ip_h(remote_addr string,pvs bigint,hour string); insert into table dw_user_dstc_ip_h select remote_addr,count(1) as pvs,concat(

第2节 网站点击流项目(下):7、hive的级联求和

一.hive级联求和的简单例子: create table t_salary_detail(username string,month string,salary int)row format delimited fields terminated by ','; load data local inpath '/export/servers/hivedatas/accumulate/t_salary_detail.dat' into table t_salary_detail; 用户 时间 收

网站点击流数据分析项目-

1:网站点击流数据分析项目推荐书籍: 可以看看百度如何实现这个功能的:https://tongji.baidu.com/web/welcome/login 1 网站点击流数据分析,业务知识,推荐书籍: 2 <网站分析实战——如何以数据驱动决策,提升网站价值>王彦平,吴盛锋编著 http://download.csdn.net/download/biexiansheng/10160197 2:整体技术流程及架构: 2.1 数据处理流程    该项目是一个纯粹的数据分析项目,其整体流程基本上就是依

02.网站点击流数据分析项目_模块开发_数据采集

3 模块开发--数据采集 3.1 需求 数据采集的需求广义上来说分为两大部分. 1)是在页面采集用户的访问行为,具体开发工作: 1.开发页面埋点js,采集用户访问行为 2.后台接受页面js请求记录日志 此部分工作也可以归属为"数据源",其开发工作通常由web开发团队负责 2)是从web服务器上汇聚日志到HDFS,是数据分析系统的数据采集,此部分工作由数据分析平台建设团队负责, 具体的技术实现有很多方式: Shell脚本:优点:轻量级,开发简单:缺点:对日志采集过程中的容错处理不便控制

大数据学习——SparkStreaming整合Kafka完成网站点击流实时统计

1.安装并配置zk 2.安装并配置Kafka 3.启动zk 4.启动Kafka 5.创建topic [[email protected] kafka]# bin/kafka-console-producer.sh --broker-list mini1:9092 --topic cyf-test 程序代码 package org.apache.spark import java.net.InetSocketAddress import org.apache.spark.HashPartition

点击流数据(Click Stream Data)及其应用

点击流(Click Stream)是指用户在网站上持续访问的轨迹.众所周知,用户对网站的每次访问包含了一系列的点击动作行为,这些点击行为数据就构成了点击流数据(Click Stream Data),它代表了用户浏览网站的整个流程.目前点击流数据的获取方法有很多,例如通过JS进行事件捕获.发布客户端应用进行采集.网站日志分析等等,本文仅以网站日志分析为例进行阐述. 点击流和网站日志是两个不同的概念,点击流是从用户的角度出发,注重用户浏览网站的整个流程:而网站日志是面向整个站点,它包含了用户行为数据

点击流日志分析

课程介绍 课程名称: 1.什么是点击流系统?记录用户在网站上的操作,用户行为轨迹. 2.日志有哪些需要注意的地方,如何采集日志(flume),日志格式,日志包含的信息量(字段) 3.分析什么? 网址来源,TOPK 客户端流量占比 Android.IOS...... 网页热力图 课程目标: 1. 掌握点击流系统的架构及工作原理 2. 掌握点击点击流中常见的字段及其业务含义 3. 掌握点击流分析系统开发 课程大纲: 1. 背景知识 2. 需求分析 3. 架构设计 4. Storm程序开发 5. 同步

Python 利用 BeautifulSoup 爬取网站获取新闻流

0. 引言 介绍下 Python 用 Beautiful Soup 周期性爬取 xxx 网站获取新闻流: 图 1 项目介绍 1. 开发环境 Python: 3.6.3 BeautifulSoup:   4.2.0 , 是一个可以从HTML或XML文件中提取数据的Python库* ( BeautifulSoup 的中文官方文档:https://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/ ) 2. 代码介绍 实现主要分为三个模块: 1. 计时