简体   繁体   中英

Call AWS Insight query from AWS Lambda

I need to extract some data from CloudWatch Logs each day.

Today, i use use Insight to get only data i want to export.

I would like to automate this export.

It is possible to call an Insight function from Lamba?

Or there is any solution to export filtered data from CloudWatch?

(A Lambda function is already subscribed to the CloudWatch Stream and it is not possible for me to use this and it is impossible to add another subscription)

You can call CloudWatch Logs Insights with the SDK (methods with query in the name): https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client.get_query_results

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM