Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Specifying log delivery using the AWS CLI

Focus mode
Specifying log delivery using the AWS CLI - Amazon ElastiCache

Slow Log

Create a replication group with slow log delivery to CloudWatch Logs.

For Linux, macOS, or 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" }'

For 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" }'

Modify a replication group to deliver slow log to CloudWatch Logs

For Linux, macOS, or 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" }'

For 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" }'

Modify a replication group to disable slow log delivery

For Linux, macOS, or Unix:

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

For Windows:

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

Engine Log

Create a replication group with engine log delivery to CloudWatch Logs.

For Linux, macOS, or 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" }'

For 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" }'

Modify a replication group to deliver engine log to Firehose

For Linux, macOS, or 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" }'

For 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" }'

Modify a replication group to switch to engine format

For Linux, macOS, or Unix:

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

For Windows:

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

Modify a replication group to disable engine log delivery

For Linux, macOS, or Unix:

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

For Windows:

aws elasticache modify-replication-group ^ --replication-group-id test-slow-log ^ --apply-immediately ^ --log-delivery-configurations ' { "LogType":"engine-log", "Enabled":false }'
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.