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
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
Transcript
12 slides
いい感じに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を使ってみた
More Decks by YouYou
See All by YouYou
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
330
今インフラ技術をイチから学び直すなら
yuhta28
1
330
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
3
710
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
910
Pulumiを触ってみよう
yuhta28
1
2.8k
Other Decks in Technology
See All in Technology
メルカリの小規模チーム「Pod」で、 エンジニアがデータアナリストなしで、 AIを使ってデータ分析の自走を目指す取り組み
jackojacko_
0
330
SORACOM × AWS IoT Core でSREする
butadora
0
120
設計手法を「道具」として使いこなすために
a_suenami
7
1.6k
Platform Engineering をベースとした Agentic Software Factory の実践
110y
2
790
From vibe coding to reliable (agentic) development
jcabot
0
150
攻撃と守りは何が変わり、何が変わらないのか~最近の不正アクセスから考える、リスク評価と標準の使いどころ
oidfj
2
300
「任されビリティ」で引き受けて「よしなりてぃ」に頼らず任せる / Accept tasks with "makasarebility" and hand them over without relying on "yoshinarily"
pauli
1
880
変更差分を読むために環境を整備しよう
pipepasta
1
610
gradle-best-practices 使ってみた
mikanichinose
0
220
AWS Blocksで AIエージェント作れるの知ってます?
kmiya84377
1
150
[関西Kaggler会 20261113] 続・コミュニティコンペのススメ
nejumi
0
190
Context parameters で作る!はじめての型クラス
kworkdev
PRO
1
170
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
4k
The untapped power of vector embeddings
frankvandijk
2
2k
Site-Speed That Sticks
csswizardry
13
1.6k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
470
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
360
Paper Plane
katiecoart
PRO
6
55k
Thoughts on Productivity
jonyablonski
76
5.5k
Building Adaptive Systems
keathley
44
3.3k
How GitHub (no longer) Works
holman
316
150k
How to make the Groovebox
asonas
2
2.6k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.2k
Optimising Largest Contentful Paint
csswizardry
37
4k