This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"time" | |
v1 "k8s.io/api/core/v1" | |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |
"k8s.io/apimachinery/pkg/watch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43c43 | |
< fs.dentry-state = 40564 25626 45 0 0 0 | |
--- | |
> fs.dentry-state = 44527 29373 45 0 0 0 | |
47,49c47,49 | |
< fs.file-nr = 960 0 199438 | |
< fs.inode-nr = 36858 492 | |
< fs.inode-state = 36858 492 0 0 0 0 0 | |
--- | |
> fs.file-nr = 992 0 199438 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
ファイルで保存したslow-query-logをパースしてcwlogsに保存する aws lambda function | |
RDSのクラスタ単位で実行 | |
1時間に1回のスケジュールで実行させる(毎時5分など) | |
(rdsが1時間に1回のログローテートなのでそれに合わせて実行させる) | |
一番最近(=1時間以内)にローテートで作られたログファイルが処理の対象 | |
###環境変数### | |
TARGET_CLUSTER / 対象クラスタ名 |