Amazon CloudFrontのレポート画面でCSVのダウンロードをしてみた

eyecatch-cloudfront

はじめに

清水です。Amazon CloudFrontではReport & Analytics機能として、AWS Managemetn Console上から以下の項目を確認できます。

  • Cache Statistics
  • Monitoring and Alarms
  • Popular Objects
  • Top Referrers
  • Usage
  • Viewers

今回はこの機能(レポート画面)からCSVダウンロード機能を使ってみましたのでまとめてみたいと思います。各レポート画面では下記のように[CSV]ボタンがありますので、これをクリックするとそのレポート内容がCSVとしてダウンロードできます。

cloudfront-csv-004

実際にレポート画面からCSVをダウンロードしてみた

それでは実際にレポート画面からCSVファイルをダウンロードしてみます。今回CloudFrontの使用状況としては、オリジンサーバがライブ映像配信を行えるストリーミングサーバ(Wowza Streaming Engine)で、実際に1クライアントがライブ映像配信を視聴している、というものでした。

Monitoring and Alarms

まずはMonitoring and Alarms画面でRequests、Data Transfer、Error Rateを確認してみます。 AWS Management Consoleでのレポート画面は以下のようになっていました。

cloudfront-csv-001 cloudfront-csv-002

そしてダウンロードしたCSVファイルは下記になります。

"Version","1",,,,,,,
"Report","CloudWatch",,,,,,,
"DistributionID","E1234567890ABC",,,,,,,
"StartDateUTC","2017-04-20 06:11:26",,,,,,,
"EndDateUTC","2017-04-20 07:11:26",,,,,,,
"GeneratedTimeUTC","2017-04-20 07:11:27",,,,,,,
"Granularity","ONE_MINUTE",,,,,,,
,,,,,,,,
"DistributionID","FriendlyName","TimeBucket","Requests","BytesDownloaded","BytesUploaded","TotalErrorRatePct","4xxErrorRatePct","5xxErrorRatePct"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:44:00","4","4186108","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:45:00","8","14794667","0","12.50","12.50","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:46:00","7","10534938","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:47:00","11","19515261","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:48:00","7","13049999","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:49:00","11","20332281","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:50:00","10","11238059","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:51:00","8","12246047","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:52:00","10","17689833","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:53:00","9","13750928","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:54:00","8","11470726","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:55:00","11","22942109","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:56:00","9","12515031","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:57:00","9","16627509","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:58:00","10","18414946","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 06:59:00","9","12689102","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 07:00:00","9","16322568","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 07:01:00","10","18980822","0","0.00","0.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 07:02:00","4","3326","0","25.00","25.00","0.00"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","2017-04-20 07:07:00","1","638","0","100.00","100.00","0.00"

グラフだと大きな変化は把握できるのですが、詳細な値をつかむのは少々難しいです。CSVで確認することによりこちらがカバーできますね。 またグラフのほうは時間によって流れてしまう、など閲覧できる条件がある程度限定されてしまうのですが、CSVに残すことで期限なく確認ができます。(記事執筆時、2週間分のデータまではレポート画面で閲覧できます。ただし時間軸の縮尺の選択ができないなどの制限があります。)

なお、CSVファイル内の各項目のについてはCloudFrontの開発者ガイドに詳細が記載されています。

Popular Objects

続いてPopular Ojbectについても確認してみます。レポート画面では下記のように、リクエスト数の多かったObjectや、キャッシュHit/Missが多かったObjectなどが確認できます。

cloudfront-csv-003

ダウンロードしたCSVファイルは下記になります。プログラムと連携して分析を行う等の場合に役に立ちそうですね。

"Version","1",,,,,,,,,,,,
"Report","PopularObjects",,,,,,,,,,,,
"DistributionID","E1234567890ABC",,,,,,,,,,,,
"StartDateUTC","2017-04-07 00:00:00",,,,,,,,,,,,
"EndDateUTC","2017-04-20 23:59:59",,,,,,,,,,,,
"GeneratedTimeUTC","2017-04-20 07:11:40",,,,,,,,,,,,
,,,,,,,,,,,,,
"DistributionID","FriendlyName","Object","RequestCount","HitCount","MissCount","HitCountPct","BytesFromMisses","TotalBytes","IncompleteDownloadCount","Http2xx","Http3xx","Http4xx","Http5xx"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/chunklist_w609786358.m3u8","59","0","58","0","51807","52445","0","58","0","1","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/playlist.m3u8","2","0","2","0","1679","1679","0","2","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_204.ts","1","0","1","0","2333391","2333391","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_203.ts","1","0","1","0","1869407","1869407","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_202.ts","1","0","1","0","3904883","3904883","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_201.ts","1","0","1","0","2563315","2563315","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_200.ts","1","0","1","0","1866775","1866775","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_199.ts","1","0","1","0","2306695","2306695","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_198.ts","1","0","1","0","4133679","4133679","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_197.ts","1","0","1","0","1866023","1866023","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_196.ts","1","0","1","0","2323615","2323615","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_195.ts","1","0","1","0","4091379","4091379","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_194.ts","1","0","1","0","1850231","1850231","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_193.ts","1","0","1","0","2338843","2338843","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_192.ts","1","0","1","0","3849799","3849799","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_191.ts","1","0","1","0","2076207","2076207","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_190.ts","1","0","1","0","2345235","2345235","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_189.ts","1","0","1","0","1562967","1562967","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_188.ts","1","0","1","0","4400075","4400075","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_187.ts","1","0","1","0","2301055","2301055","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_186.ts","1","0","1","0","1629707","1629707","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_185.ts","1","0","1","0","4334463","4334463","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_184.ts","1","0","1","0","2337715","2337715","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_183.ts","1","0","1","0","1718067","1718067","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_182.ts","1","0","1","0","2402199","2402199","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_181.ts","1","0","1","0","4233695","4233695","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_180.ts","1","0","1","0","1756419","1756419","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_179.ts","1","0","1","0","2419119","2419119","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_178.ts","1","0","1","0","4175039","4175039","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_177.ts","1","0","1","0","1748899","1748899","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_176.ts","1","0","1","0","2417803","2417803","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_175.ts","1","0","1","0","1749839","1749839","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_174.ts","1","0","1","0","4114127","4114127","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_173.ts","1","0","1","0","2483791","2483791","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_172.ts","1","0","1","0","1713367","1713367","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_171.ts","1","0","1","0","4119391","4119391","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_170.ts","1","0","1","0","2495447","2495447","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_169.ts","1","0","1","0","1699455","1699455","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_168.ts","1","0","1","0","4103975","4103975","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_167.ts","1","0","1","0","2453711","2453711","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_166.ts","1","0","1","0","1687423","1687423","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_165.ts","1","0","1","0","4128039","4128039","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_164.ts","1","0","1","0","2449575","2449575","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_163.ts","1","0","1","0","1742131","1742131","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_162.ts","1","0","1","0","2318351","2318351","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_161.ts","1","0","1","0","4056223","4056223","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_160.ts","1","0","1","0","1304091","1304091","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_159.ts","1","0","1","0","2207995","2207995","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_158.ts","1","0","1","0","3997943","3997943","0","1","0","0","0"
"E1234567890ABC","E1234567890ABC (wowza-live.example.com)","/live/myStream/media_w609786358_157.ts","1","0","1","0","1877679","1877679","0","1","0","0","0"

まとめ

Amazon CloudFrontのレポート画面のCSVダウンロード機能を紹介しました。レポート画面自体、CloudFrontのリリース時にあったものではなく機能拡張の一環として追加されたものです。例えば以下の大瀧のエントリに当時の機能追加の詳細がまとまっています。

ここからさらに機能追加で今回紹介したCSVダウンロードが使えるようになった模様です。(2014年の12月のBlack Belt Tech Webinar資料には記載がなく、2016年1月のBlack Belt Tech Webinar資料に[NEW]マーク付きで記載があるので、この間にリリースされた機能と推測しています。)

CSVダウンロード登場以前のレポート画面追加も機能的に大変うれしいものでしたが、CSVでダウンロードすることで具体的な数値として手元に残せるので、こちらの機能も大変便利だと思いました。

AWS Cloud Roadshow 2017 福岡

  • Satsuya

    簡単の説明ありがとう!

    • Toshiya Shimizu

      コメントありがとうございます!ご参考になりましたら幸いです。