Amazon web services 从aws cli向cloudwatch写入日志

Amazon web services 从aws cli向cloudwatch写入日志,amazon-web-services,aws-cli,amazon-cloudwatch,amazon-cloudwatchlogs,Amazon Web Services,Aws Cli,Amazon Cloudwatch,Amazon Cloudwatchlogs,我正在尝试向cloudwatch写日志(只是为了了解它是如何工作的) 因此,我从aws cli(已配置)发出以下命令 aws日志放置日志事件--日志组名称testgroup--日志流名称teststream1--日志事件时间戳=1587488538,消息=hello 在cloudwatch上,组名和流日志已存在,且名称正确 该命令的输出如下所示 { “rejectedLogEventsInfo”:{ “tooOldLogEventEndIndex”:1 } } 我使用的用户附加了“Adminis

我正在尝试向cloudwatch写日志(只是为了了解它是如何工作的)

因此,我从aws cli(已配置)发出以下命令

aws日志放置日志事件--日志组名称testgroup--日志流名称teststream1--日志事件时间戳=1587488538,消息=hello

在cloudwatch上,组名和流日志已存在,且名称正确

该命令的输出如下所示

{
“rejectedLogEventsInfo”:{
“tooOldLogEventEndIndex”:1
}
}


我使用的用户附加了“AdministratorAccess”策略(并且确保我也添加了“CloudWatchFullAccess”策略)

您需要将时间戳转换为毫秒版本(在您的情况下乘以1000)


请检查

您需要将时间戳转换为毫秒版本(在您的情况下乘以1000)

请查收

aws logs put-log-events --log-group-name testgroup --log-stream-name teststream1 --log-events timestamp=1587488538000,message=hello