Amazon-Rds

如何從“aws rds describe-events”中過濾 rds 事件?

  • June 27, 2019

如果我跑aws --profile dev rds describe-events

我得到這樣的輸出:

{
   "Events": [
       {
           "SourceIdentifier": "dev-important-data",
           "SourceType": "db-instance",
           "Message": "CloudWatch Logs Export enabled for logs [audit, error, general, slowquery]",
           "EventCategories": [],
           "Date": "2019-06-27T05:26:02.469Z",
           "SourceArn": "arn:aws:rds:us-east-1:141888792464:db:dev-important-data"
       }
}

是否可以對輸出應用過濾器,這樣我只會看到來自某個特定的事件SourceIdentifier

我試過

aws --profile dev rds describe-events --duration 1000 --filters "Name=SourceIdentifier,Values=dev-important-data"

但我得到了錯誤:

Unrecognized filter name: SourceIdentifier

然後我嘗試使用 value Events.SourceIdentifier,但仍然是同樣的錯誤:Unrecognized filter name: Events.SourceIdentifier

建構過濾器的正確方法是什麼?

我應該使用-source-identifier--source-type=db-instance參數

引用自:https://serverfault.com/questions/973077