1 日前の IP アドレス 42.0.192.0 のアクセス状況を照会する場合、ステートメントは次のようになります。
remote_addr: 42.0.192.0 | select date_format(date_trunc('hour', __time__), '%m-%d %H:%i')
as time, count(1) as PV group by time order by time limit 1000
X 軸に time、左 Y 軸に PV、右 Y 軸に UV、列マーカーに PV を指定します。
図 1. 単純折れ線グラフ
軸折れ線グラフ
1 日前の PV および UV のアクセス状況を照会する場合、ステートメントは次のようになります。
* | select date_format(date_trunc('hour', __time__), '%m-%d %H:%i') as time, count(1) as PV, approx_distinct(remote_addr) as UV group by time order by time limit 1000