我正在尝试将日志写入cloudwatch(只是为了了解其工作原理)
因此从aws-cli(已配置)中,我正在发出此命令
aws logs put-log-events --log-group-name testgroup --log-stream-name teststream1 --log-events timestamp=1587488538,message=hello
在cloudwatch上,组名和流日志已经存在,并且名称正确
命令的输出如下
{
"rejectedLogEventsInfo": {
"tooOldLogEventEndIndex": 1
}
}
我正在使用的用户已附加“ AdministratorAccess”策略(并确保我也添加了“ CloudWatchFullAccess”策略)
答案 0 :(得分:2)
您需要将时间戳转换为毫秒版本(您的情况乘以1000)
aws logs put-log-events --log-group-name testgroup --log-stream-name teststream1 --log-events timestamp=1587488538000,message=hello
请检查examples