Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
いい感じにCLWをtailしてみる
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
YouYou
July 31, 2021
Technology
2.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
いい感じにCLWをtailしてみる
ブログページ↓
https://zenn.dev/yuta28/articles/cloudwatch-fast-tail
YouYou
July 31, 2021
More Decks by YouYou
See All by YouYou
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
310
今インフラ技術をイチから学び直すなら
yuhta28
1
310
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
3
690
Datadog外形監視基盤をEC2から ECSへ移行してみた
yuhta28
0
1.9k
アウトプット頑張ったら企業からLT登壇の依頼がきた話
yuhta28
1
1.9k
小さなことから始めるAWSコスト最適入門
yuhta28
1
1.5k
Datadogのコストも監視しよう
yuhta28
1
1.1k
Rcloneを使った定期的なストレージ同期
yuhta28
0
880
Pulumiを触ってみよう
yuhta28
1
2.8k
Other Decks in Technology
See All in Technology
事業課題から技術的負債に向き合う
sansantech
PRO
2
2k
顧客に向き合う開発組織へ。リアーキテクチャとフィーチャーチーム化で挑む組織改革
safie
0
2.1k
Reactの設計論
uhyo
24
14k
山手線を徒歩で一周してわかった、 位置情報アプリは「足」が最強のデバッガー
hinakko
0
170
アプリログインとWeb認証基盤をつなぐ ASWebAuthenticationSession 作法
shimastripe
1
340
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
750
その Lambda、8分で 管理者権限まで奪われます
k1nakayama
6
3.1k
Vibe Coding で作ったプロダクトをどう安全に動かすか / How to Safely Run Products Built with Vibe Coding
glidenote
0
170
10Xに技術的負債をもたらした「2つの境界の歪み」その構造と解消への営み
10xinc
0
2.1k
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
9
4.6k
登壇の自信を奪う3匹のオバケ / 3 Ghosts That Rob You of Your Confidence in Public Speaking
pauli
9
1k
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
750
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
280
Being A Developer After 40
akosma
91
590k
The Spectacular Lies of Maps
axbom
PRO
1
1k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
610
Building a Scalable Design System with Sketch
lauravandoore
464
34k
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
Darren the Foodie - Storyboard
khoart
PRO
4
3.9k
The Invisible Side of Design
smashingmag
301
52k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
280
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
810
Transcript
いい感じにCLWをtailしてみる
Name:ユータ Occupation:SRE Twitter:@Y0u281 (オーでなくゼロです) ブログ:https://zenn.dev/yuta28 → 普段触るもの:AWS Ansible Linux Mint
自己紹介 Twitter
目次 • 現在のCloudWatch Logsの課題 • cwの紹介 • つかってみた • 問題点
• まとめ
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 ~~~
CloudWatch Logsの課題 ログストリーム毎にtail -fができない!!
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のログも出てくる!
cwの紹介 Goで作られたターミナル上でのtail出力を良くしてくれるツール • pipやnpmなどのパッケージ不要 • 高速 • 複数のロググループをまとめてtail可能 • ログストリーム別にフィルタリング可能
https://github.com/lucagrulla/cw
つかってみた $ brew tap lucagrulla/tap $ brew install cw $
cw ls groups /ecs/first-run-task-definition RDSOSMetrics access_log インストールはbrewで簡単♪ lsサブコマンドでグループリスト表示
つかってみた $ 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]
問題点 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 🤔🤔🤔🤔🤔
まとめ • ストリーム別の出力は便利 • 複数グループもtailできる • エラーは修正されることを祈る ◦ 自信あったらPR
ありがとうございました 詳細は私のブログで ↓ CloudWatch Logsをいい感じにtail してくれるcwを使ってみた