Upgrade to Pro — share decks privately, control downloads, hide ads and more …

いい感じにCLWをtailしてみる

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

 いい感じにCLWをtailしてみる

Avatar for YouYou

YouYou

July 31, 2021
Tweet

More Decks by YouYou

Other Decks in Technology

Transcript

  1. CloudWatch Logsの課題 $ aws logs tail --follow access_log 2021-07-22T07:45:55.422000+00:00 wordpress1

    ~~~ 2021-07-22T07:49:31.689000+00:00 wordpress2 ~~~ 2021-07-22T07:54:52.911000+00:00 wordpress1 ~~~ 2021-07-22T07:55:05.949000+00:00 wordpress2 ~~~ 2021-07-22T07:55:15.949000+00:00 wordpress2 ~~~
  2. CloudWatch Logsの課題 $ aws logs tail --follow access_log 2021-07-22T07:45:55.422000+00:00 wordpress1

    ~~~ 2021-07-22T07:49:31.689000+00:00 wordpress2 ~~~ 2021-07-22T07:54:52.911000+00:00 wordpress1 ~~~ 2021-07-22T07:55:05.949000+00:00 wordpress2 ~~~ 2021-07-22T07:55:15.949000+00:00 wordpress2 ~~~ 特定のWordPressのログだけ見たいのに他の WordPressのログも出てくる!
  3. つかってみた $ brew tap lucagrulla/tap $ brew install cw $

    cw ls groups /ecs/first-run-task-definition RDSOSMetrics access_log インストールはbrewで簡単♪ lsサブコマンドでグループリスト表示
  4. つかってみた $ cw tail access_log:wordpress1 --follow --stream-name wordpress1 - XX.XX.XX.XX

    - - [22/Jul/2021:09:24:53 +0000] wordpress1 - XX.XX.XX.XX - - [22/Jul/2021:09:24:53 +0000] wordpress1 - XX.XX.XX.XX - - [22/Jul/2021:09:24:54 +0000] wordpress1 - XX.XX.XX.XX - - [22/Jul/2021:09:24:54 +0000] $ cw tail access_log --follow --stream-name wordpress2 - XX.XX.XX.XX - - [22/Jul/2021:09:19:33 +0000] wordpress2 - XX.XX.XX.XX - - [22/Jul/2021:09:20:29 +0000] wordpress1 - XX.XX.XX.XX - - [22/Jul/2021:09:20:48 +0000]
  5. 問題点 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ wordpress1 - XX.XX.XX.XX - - [22/Jul/2021:09:29:45 +0000] wordpress1

    - XX.XX.XX.XX - - [22/Jul/2021:09:29:47 +0000] operation error CloudWatch Logs: FilterLogEvents, exceeded maximum number of attempts, 3, https response error StatusCode: 400, RequestID: 69b981bb-0bcf-4263-951e-73aabf9ab379, api error ThrottlingException: Rate exceeded 🤔🤔🤔🤔🤔