Angeben der Protokollzustellung mit dem AWS CLI - Amazon ElastiCache

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

Angeben der Protokollzustellung mit dem AWS CLI

Slow-Protokoll

Erstellen Sie eine Replikationsgruppe mit langsamer Protokollzustellung an CloudWatch Logs.

Für Linux, macOS oder Unix:

aws elasticache create-replication-group \ --replication-group-id test-slow-log \ --replication-group-description test-slow-log \ --engine redis \ --cache-node-type cache.r5.large \ --num-cache-clusters 2 \ --log-delivery-configurations '{ "LogType":"slow-log", "DestinationType":"cloudwatch-logs", "DestinationDetails":{ "CloudWatchLogsDetails":{ "LogGroup":"my-log-group" } }, "LogFormat":"json" }'

Für Windows:

aws elasticache create-replication-group ^ --replication-group-id test-slow-log ^ --replication-group-description test-slow-log ^ --engine redis ^ --cache-node-type cache.r5.large ^ --num-cache-clusters 2 ^ --log-delivery-configurations '{ "LogType":"slow-log", "DestinationType":"cloudwatch-logs", "DestinationDetails":{ "CloudWatchLogsDetails":{ "LogGroup":"my-log-group" } }, "LogFormat":"json" }'

Ändern Sie eine Replikationsgruppe, um das Protokoll langsam in CloudWatch Logs zu speichern

Für Linux, macOS oder Unix:

aws elasticache modify-replication-group \ --replication-group-id test-slow-log \ --apply-immediately \ --log-delivery-configurations ' { "LogType":"slow-log", "DestinationType":"cloudwatch-logs", "DestinationDetails":{ "CloudWatchLogsDetails":{ "LogGroup":"my-log-group" } }, "LogFormat":"json" }'

Für Windows:

aws elasticache modify-replication-group ^ --replication-group-id test-slow-log ^ --apply-immediately ^ --log-delivery-configurations ' { "LogType":"slow-log", "DestinationType":"cloudwatch-logs", "DestinationDetails":{ "CloudWatchLogsDetails":{ "LogGroup":"my-log-group" } }, "LogFormat":"json" }'

Ändern einer Replikationsgruppe, um die langsame Protokollzustellung zu deaktivieren

Für Linux, macOS oder Unix:

aws elasticache modify-replication-group \ --replication-group-id test-slow-log \ --apply-immediately \ --log-delivery-configurations ' { "LogType":"slow-log", "Enabled":false }'

Für Windows:

aws elasticache modify-replication-group ^ --replication-group-id test-slow-log ^ --apply-immediately ^ --log-delivery-configurations ' { "LogType":"slow-log", "Enabled":false }'

Engine-Protokoll

Erstellen Sie eine Replikationsgruppe mit der Übermittlung von CloudWatch Engine-Protokollen an Logs.

Für Linux, macOS oder Unix:

aws elasticache create-replication-group \ --replication-group-id test-slow-log \ --replication-group-description test-slow-log \ --engine redis \ --cache-node-type cache.r5.large \ --num-cache-clusters 2 \ --log-delivery-configurations '{ "LogType":"engine-log", "DestinationType":"cloudwatch-logs", "DestinationDetails":{ "CloudWatchLogsDetails":{ "LogGroup":"my-log-group" } }, "LogFormat":"json" }'

Für Windows:

aws elasticache create-replication-group ^ --replication-group-id test-slow-log ^ --replication-group-description test-slow-log ^ --engine redis ^ --cache-node-type cache.r5.large ^ --num-cache-clusters 2 ^ --log-delivery-configurations '{ "LogType":"engine-log", "DestinationType":"cloudwatch-logs", "DestinationDetails":{ "CloudWatchLogsDetails":{ "LogGroup":"my-log-group" } }, "LogFormat":"json" }'

Ändern Sie eine Replikationsgruppe, um das Engine-Protokoll an Firehose zu übermitteln

Für Linux, macOS oder Unix:

aws elasticache modify-replication-group \ --replication-group-id test-slow-log \ --apply-immediately \ --log-delivery-configurations ' { "LogType":"engine-log", "DestinationType":"kinesis-firehose", "DestinationDetails":{ "KinesisFirehoseDetails":{ "DeliveryStream":"test" } }, "LogFormat":"json" }'

Für Windows:

aws elasticache modify-replication-group ^ --replication-group-id test-slow-log ^ --apply-immediately ^ --log-delivery-configurations ' { "LogType":"engine-log", "DestinationType":"kinesis-firehose", "DestinationDetails":{ "KinesisFirehoseDetails":{ "DeliveryStream":"test" } }, "LogFormat":"json" }'

Ändern einer Replikationsgruppe zum Wechseln in das Engine-Format

Für Linux, macOS oder Unix:

aws elasticache modify-replication-group \ --replication-group-id test-slow-log \ --apply-immediately \ --log-delivery-configurations ' { "LogType":"engine-log", "LogFormat":"json" }'

Für Windows:

aws elasticache modify-replication-group ^ --replication-group-id test-slow-log ^ --apply-immediately ^ --log-delivery-configurations ' { "LogType":"engine-log", "LogFormat":"json" }'

Ändern einer Replikationsgruppe zur Deaktivierung der Übermittlung von Engine-Protokollen

Für Linux, macOS oder Unix:

aws elasticache modify-replication-group \ --replication-group-id test-slow-log \ --apply-immediately \ --log-delivery-configurations ' { "LogType":"engine-log", "Enabled":false }'

Für Windows:

aws elasticache modify-replication-group ^ --replication-group-id test-slow-log ^ --apply-immediately ^ --log-delivery-configurations ' { "LogType":"engine-log", "Enabled":false }'