0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[JAWS-UG CLI] CloudWatch Logs:#10 サブスクリプションフィルタの削除

Posted at

前提条件

CloudWatch Logsへの権限

CloudWatch Logsに対してフル権限があること。

AWS CLI

以下のバージョンで動作確認済

  • AWS CLI 1.11.28
コマンド
aws --version
結果(例)
      aws-cli/1.11.7 Python/2.7.11 Darwin/15.6.0 botocore/1.4.64

バージョンが古い場合は最新版に更新しましょう。

コマンド
sudo -H pip install -U awscli
  1. 準備
    ===========

AWS IDの取得

変数の設定
AWS_ID=$( \
        aws sts get-caller-identity \
          --query 'Account' \
          --output text \
) \
        && echo ${AWS_ID}

結果(例)

  XXXXXXXXXXXX
  1. 事前作業
    ===========

1.1. ロググループの指定

変数の設定
LOGS_GROUP_NAME='RDSOSMetrics'

1.2. ログフィルタの指定

変数の設定
LOGS_FILTER_NAME='datadog'
  1. サブスクリプションフィルタ削除
    =================================

サブスクリプションフィルタを作成します。

変数の確認
cat << ETX

        LOGS_GROUP_NAME:      ${LOGS_GROUP_NAME}
        LOGS_FILTER_NAME:     ${LOGS_FILTER_NAME}

ETX
コマンド
aws logs delete-subscription-filter \
        --log-group-name ${LOGS_GROUP_NAME} \
        --filter-name ${LOGS_FILTER_NAME}

結果(例):

  (戻り値なし)
  1. 事後作業
    ===========
コマンド
aws logs describe-subscription-filters \
        --log-group-name ${LOGS_GROUP_NAME} \
        --filter-name-prefix ${LOGS_FILTER_NAME}
結果(例)
{
    "subscriptionFilters": []
}

完了

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?