デフォルトでLogstoreName-iis-dashboardダッシュボードが用意されています。 上記を設定したら、ダッシュボードにリアルタイムデータを表示できます (クライアント IP 分布、HTTP ステータスの割合など)。
図 7. ダッシュボード
クライアント IP 分布を取得するステートメントは、次のとおりです。
| select ip_to_geo("c-ip") as country, count(1) as c group by ip_to_geo("c-ip") limit 100
図 8. クライアント IP 分布
ページビューおよびユニークビジターを確認するステートメントは、次のとおりです。
*| select approx_distinct("c-ip") as uv ,count(1) as pv , date_format(date_trunc('hour', __time__), '%m-%d %H:%i') as time group by date_format(date_trunc('hour', __time__), '%m-%d %H:%i') order by time limit 1000
図 9. ページビューおよびユニークビジター
HTTPステータスの割合を取得するステートメントは、次のとおりです。
*| select count(1) as pv ,"sc-status" group by "sc-status"
図 10. HTTP ステータスの割合
送受信トラフィックを表示するステートメントは、次のとおりです。
*| select sum("sc-bytes") as net_out, sum("cs-bytes") as net_in ,date_format(date_trunc('hour', time), '%m-%d %H:%i') as time group by date_format(date_trunc('hour', time), '%m-%d %H:%i') order by time limit 10000
図 11. 送受信トラフィック
HTTP リクエストメソッドの割合を取得するステートメントは、次のとおりです。
*| select count(1) as pv ,"cs-method" group by "cs-method"
図 12. HTTP リクエストメソッドの割合
使用ブラウザー比率を取得するステートメントは、次のとおりです。
*| select count(1) as pv, case when "user-agent" like '%Chrome%' then 'Chrome' when "user-agent" like '%Firefox%' then 'Firefox' when "user-agent" like '%Safari%' then 'Safari' else 'unKnown' end as "user-agent" group by case when "user-agent" like '%Chrome%' then 'Chrome' when "user-agent" like '%Firefox%' then 'Firefox' when "user-agent" like '%Safari%' then 'Safari' else 'unKnown' end order by pv desc limit 10
図 13. 使用ブラウザー比率
訪問数の多い URI トップ 10を表示するステートメントは、次のとおりです。
*| select count(1) as pv, split_part("cs-uri-stem",'?',1) as path group by split_part("cs-uri-stem",'?',1) order by pv desc limit 10