I have created an AWS CloudWatch log group with a name which was not very future proof. Is it possible to rename such a log group? I could find no option to do this via the CloudWatch console.
I guess an alternative would be to export the content of the log group, create a new log group with the desired name, and then re-consume the exported logs to the new log group. I would prefer to avoid this approach though, as (apart from being tedious) this would reset the ingestionTime
of all the log events in the log group.
Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/ . In the navigation pane, choose Log groups. Choose Actions, and then choose Create log group. Enter a name for the log group, and then choose Create log group.
CloudWatch Logs Use caseslog retention setting can be modified, so that any log events older than this setting are automatically deleted.
You can't change the name of an existing alarm. You can copy an alarm and give the new alarm a different name. To copy an alarm, select the check box next to the alarm name in the alarm list and choose Action, Copy. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/ .
Encryption using AWS KMS is enabled at the log group level, by associating a key with a log group, either when you create the log group or after it exists. CloudWatch Logs now supports encryption context, using kms:EncryptionContext:aws:logs:arn as the key and the ARN of the log group as the value for that key.
It does not seem to be possible at the current time. The AWS CLI only lists the following log-group
-related actions at this time:
My solution, since the log-group was only recently created and all the original log files were still on the EC2 instance, was to:
$ /etc/init.d/awslogs stop
./var/awslogs/etc/awslogs.conf
on the EC2 instance to specify the desired log group name instead of the previous one.$ /etc/init.d/awslogs start
.Quite the tedious procedure, especially with having to manually move the log files, one at a time, in the correct order. Would be neat if there was functionality in the future to rename a log group.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With