Can wildcards be used to specify log groups in the CreateExportTask API for CloudWatch Logs?

Can wildcards be used to specify log groups in the CreateExportTask API for CloudWatch Logs?

Clock Icon2024.10.29

日本語版はこちら

The issue

I am considering a method to export CloudWatch Logs using the CreateExportTask API.

Since there are multiple log groups I want to export, I would like to specify them all at once, but can wildcards be used to specify log groups in the CreateExportTask API?

The solution

No, wildcards cannot be used.

In the request parameter "logGroupName" of the CreateExportTask API, the following patterns can be defined, but wildcards (*) are not included.

AWS official documentation

Pattern: [.-_/#A-Za-z0-9]+

Since wildcards cannot be used, please consider specifying each log group name in multiple schedules.

Also, please note that there is a quota of one export task per account, so concurrent execution is not possible.

Therefore, you need to execute tasks at intervals.

AWS official documentation

Export task
One active (running or pending) export task at a time, per account. This quota can't be changed.

Note

Since continuous log archiving using the CreateExportTask API is deprecated, please consider using subscriptions if continuous archiving is required.
CreateExportTask - Amazon CloudWatch Logs

We recommend that you don't regularly export to Amazon S3 as a way to continuously archive your logs. For that use case, we instaed recommend that you use subscriptions.

References

Share this article

facebook logohatena logotwitter logo

© Classmethod, Inc. All rights reserved.