1 回答
- 最新
- 投票最多
- 评论最多
0
You could write a python or other script in Lambda or off platform to query the cloud watch logs and then do the calculation between the two timestaps.
def lambda_handler(event, context):
client = boto3.client('logs')
# Specify your log groups
log_group1 = '/aws/lambda/your_lambda_function1'
log_group2 = '/aws/lambda/your_lambda_function2'
....... other code
response1 = client.start_query(
logGroupName=log_group1,
startTime=start_timestamp,
endTime=end_timestamp,
queryString='fields @timestamp, @message | sort @timestamp desc',
)
.... query other log....
calculate difference in time stamps
已回答 1 年前
Thankyou for the suggestion, sure I will try that. I guess doing it from the query will be easier, if you have a way to do it from query itself please let me know