[英]Why AWS CloudWatch Log Group and Stream Name cannot be changed?
I was trying to change AWS CloudWatch Log Group and Stream Name as follow: 我试图按以下方式更改AWS CloudWatch日志组和流名称:
cat <<EOT >> /etc/awslogs/awscli.conf
[/var/log/messages]
file = /var/log/messages
log_group_name = MY_LOG
region = ap-southeast-1
log_stream_name = {instance_id}
datetime_format = %b %d %H:%M:%S
EOT
And I've tried to stop and start CloudWatch agent, log group name and stream name could not be changed as expected. 而且我尝试停止并启动CloudWatch代理,无法按预期更改日志组名称和流名称。 Please help me how to do it. 请帮我怎么做。
It should be /etc/awslogs/awslogs.conf
and not /etc/awslogs/awscli.conf
. 它应该是/etc/awslogs/awslogs.conf
而不是/etc/awslogs/awscli.conf
。
The rest of your configuration file looks fine. 配置文件的其余部分看起来不错。
You can also check your /var/log/awslogs.log
for eventual error messages linked to IAM permissions. 您也可以检查/var/log/awslogs.log
是否有链接到IAM权限的最终错误消息。
See also Why can't I push log data to CloudWatch Logs with the awslogs agent? 另请参见为什么无法使用awslogs代理将日志数据推送到CloudWatch Logs? . 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.