阿里云日志服务:实用nginx日志查询

查看非内网IP

| SELECT client_ip as ip  WHERE  ip_to_domain(client_ip) != 'intranet' GROUP  BY  ip

| SELECT client_ip as ip,COUNT(*) as count  WHERE  ip_to_domain(client_ip) != 'intranet' GROUP  BY  ip ORDER  by count desc

分组查看UA

| SELECT user_agent as ua,COUNT(*) as count   GROUP  BY  ua ORDER  by count desc

查看请求方式

* | SELECT http_method, COUNT(*) as number GROUP BY http_method

NOT http_method :'GET'

查看写入oss的客户端IP

* | SELECT client_ip WHERE http_method ='PUT' GROUP BY client_ip

客户端IP热力图

* | select  ip_to_geo(client_ip) as address, count(1) as count group by address order by count desc
上一篇:希尔排序


下一篇:干掉mysql慢查询