字段名 | 原始日志类型 | 日志服务类型 | 说明 |
app_id | Integer | long | 腾讯云账号 APPID |
client_ip | String | text | 客户端 IP |
file_size | Integer | long | 文件大小 |
hit | String | text | 缓存 HIT / MISS,在 CDN 边缘节点命中、父节点命中均标记为 HIT |
host | String | text | 域名 |
http_code | Integer | long | HTTP 状态码 |
isp | String | text | 运营商 |
method | String | text | HTTP Method |
param | String | text | URL 携带的参数 |
proto | String | text | HTTP 协议标识 |
prov | String | text | 运营商省份 |
referer | String | text | Referer 信息,HTTP 来源地址 |
request_range | String | text | Range 参数,请求范围 |
request_time | Integer | long | 响应时间(毫秒),指节点从收到请求后响应所有回包再到客户端所花费的时间 |
request_port | String | long | 客户端与 CDN 节点建立连接的端口。若无,则为 - |
rsp_size | Integer | long | 返回字节数 |
time | Integer | long | 请求时间,UNIX 时间戳,单位为:秒 |
ua | String | text | User-Agent 信息 |
url | String | text | 请求路径 |
uuid | String | text | 请求的唯一标识 |
version | Integer | long | CDN 实时日志版本 |
* | select avg(request_time) as l, approx_percentile(request_time, 0.5) as p50, approx_percentile(request_time, 0.99) as p99, time_series(__TIMESTAMP__, '5m', '%Y-%m-%d %H:%i:%s', '0') as time group by time order by time desc limit 1440
* | select approx_percentile(request_time, 0.99) as p99
* | select * from (select * from (select * from (select date_trunc('minute', __TIMESTAMP__) as time,count(*) as errct where http_code>=400 group by time order by time desc limit 2)) order by time desc limit 1)
* | select * from (select * from (select * from (select date_trunc('minute', __TIMESTAMP__) as time,count(*) as errct where http_code>=400 group by time order by time desc limit 2)) order by time asc limit 1)
$2.errct-$1.errct >100
* | select round(sum(case when http_code<500 then 1.00 else 0.00 end) / cast(count(*) as double) * 100,1) as "健康度"
http_code<400 | select round(sum(case when hit='hit' then 1.00 else 0.00 end) / cast(count(*) as double) * 100,1) as "缓存命中率"
* | select sum(rsp_size/1024.0) / sum(request_time/1000.0) as "平均下载速度(kb/s)"
* | select ip_to_provider(client_ip) as isp , sum(rsp_size)* 1.0 /(sum(request_time)+1) as "下载速度(KB/s)" , sum(rsp_size/1024.0/1024.0) as "下载总量(MB)", count(*) as c group by isp order by c desc limit 10
* | select case when request_time < 5000 then '~5s' when request_time < 6000 then '5s~6s' when request_time < 7000 then '6s~7s' when request_time < 8000 then '7~8s' when request_time < 10000 then '8~10s' when request_time < 15000 then '10~15s' else '15s~' end as latency , count(*) as count group by latency
* | select http_code , count(*) as c where http_code >= 400 group by http_code order by c desc
* | select host , count(*) as count where http_code > 400 group by host order by count desc limit 10
* | select url , count(*) as count where http_code > 400 group by url order by count desc limit 10
* | select client_ip, ip_to_province(client_ip) as "province", ip_to_provider(client_ip) as "运营商" , count(*) as "错误次数" where http_code >= 400 group by client_ip order by "错误次数" DESC limit 100
* | select ua as "客户端版本", count(*) as "错误次数" where http_code > 400 group by ua order by "错误次数" desc limit 10
* | select ip_to_province(client_ip) as province , count(*) as c group by province order by c desc limit 50
http_code < 400 | select url ,count(*) as "访问次数", round(sum(rsp_size)/1024.0/1024.0/1024.0, 2) as "下载总量(GB)" group by url order by "访问次数" desc limit 100
* | select host, sum(rsp_size/1024) as "下载总量" group by host order by "下载总量" desc limit 100
* | SELECT CASE WHEN ip_to_country(client_ip)='香港' THEN concat(client_ip, ' ( Hong Kong )') WHEN ip_to_province(client_ip)='' THEN concat(client_ip, ' ( Unknown IP )') WHEN ip_to_provider(client_ip)='内网IP' THEN concat(client_ip, ' (Private IP )') ELSE concat(client_ip, ' ( ', ip_to_country(client_ip), '/', ip_to_province(client_ip), '/', if(ip_to_city(client_ip)='-1', 'Unknown city', ip_to_city(client_ip)), ' ',ip_to_provider(client_ip), ' )') END AS client, pv as "总访问数", error_count as "错误访问数" , throughput as "下载总量(GB)" from (select client_ip , count(*) as pv, round(sum(rsp_size)/1024.0/1024/1024.0, 1) AS throughput , sum(if(http_code > 400, 1, 0)) AS error_count from log group by client_ip order by throughput desc limit 100)
* | SELECT CASE WHEN ip_to_country(client_ip)='香港' THEN concat(client_ip, ' ( Hong Kong )') WHEN ip_to_province(client_ip)='' THEN concat(client_ip, ' ( Unknown IP )') WHEN ip_to_provider(client_ip)='内网IP' THEN concat(client_ip, ' (Private IP )') ELSE concat(client_ip, ' ( ', ip_to_country(client_ip), '/', ip_to_province(client_ip), '/', if(ip_to_city(client_ip)='-1', 'Unknown city', ip_to_city(client_ip)), ' ',ip_to_provider(client_ip), ' )') END AS client, pv as "总访问数", (pv - success_count) as "错误访问数" , throughput as "下载总量(GB)" from (select client_ip , count(*) as pv, round(sum(rsp_size)/1024.0/1024/1024.0, 1) AS throughput , sum(if(http_code < 400, 1, 0)) AS success_count from log group by client_ip order by success_count desc limit 100)
* | select time_series(__TIMESTAMP__, '1m', '%Y-%m-%dT%H:%i:%s+08:00', '0') as time, count(*) as pv,approx_distinct(client_ip) as uv group by time order by time limit 1000
本页内容是否解决了您的问题?