我有几个lambda函数。我需要抓取从所有lambda函数生成的日志,并将其加载到我们的内部数据仓库。我想到了这些解决方案。
- Pros: Works and simple to implement.
- Cons: There is no way for me to "replay". Say My exporter failed for some reason. I wouldn't be able to replay this action.
我不能创建多个导出任务。有办法解决这个问题吗?
发布于 2020-12-08 06:58:36
来自AWS文档:One active (running or pending) export task at a time, per account. This limit cannot be changed.
U可以使用以下函数检查状态是否已更改为'COMPLETED'
response = client.create_export_task(
taskName='export_cw_to_s3',
logGroupName='/ecs/',
logStreamNamePrefix=org_id,
fromTime=int((yesterday-unix_start).total_seconds() * 1000),
to=int((today-unix_start).total_seconds() * 1000),
destination='test-bucket',
destinationPrefix=f'random-string/{today.year}/{today.month}/{today.day}/{org_id}')
taskId = (response['taskId'])
status = 'RUNNING'
while status in ['RUNNING','PENDING']:
response_desc = client.describe_export_tasks(
taskId=taskId
)
status = response_desc['exportTasks'][0]['status']['code']发布于 2018-01-08 10:37:14
遇到相同的错误消息,原因是在给定的时间,每个帐户只能有一个运行/挂起的导出任务,因此此任务失败。来自AWS文档:One active (running or pending) export task at a time, per account. This limit cannot be changed. cwl.html
发布于 2020-05-22 05:54:27
有时,一个createExport任务会长期处于挂起状态,从而阻止具有相同任务的其他lambda函数运行。您可以看到这个任务并取消它,允许运行其他函数。
https://stackoverflow.com/questions/46653233
复制相似问题