Skip to content

Exporting logs to s3 is not working

0

I am trying to export a log group from Cloudwatch to S3 but its not working the export task start correctly and it says status "Completed successfully" after a few minutes so its not a permission issue but after it completes there is nothing in the bucket, or there very few logs when there are actually thousands in the log group. Logs in Cloudwatch log group

Export is "Successful"

Still Empty bucket after successful export

1 Answer
0

It appears that you're experiencing an issue where your CloudWatch log export to S3 is completing successfully, but the S3 bucket remains empty or contains fewer logs than expected. This can be a confusing situation, as the export task reports success but doesn't produce the expected results. Here are a few potential reasons and solutions to consider:

  1. Time range: Ensure that you've specified the correct time range for the export task. If the time range doesn't match the period when the logs were generated, the export might complete successfully but without transferring any data.

  2. Log stream selection: Check if you've selected the correct log streams within the log group for export. If only specific streams are chosen, this could result in fewer logs being exported than expected.

  3. S3 bucket permissions: Although you mentioned it's not a permission issue, double-check the S3 bucket policy to ensure it allows CloudWatch Logs to write objects. The policy should include permissions for both s3:GetBucketAcl and s3:PutObject actions.

  4. Encryption: If your S3 bucket uses SSE-KMS encryption, make sure the KMS key policy allows CloudWatch Logs to use the key for encryption.

  5. Export task size: There might be limitations on the size of data that can be exported in a single task. Try exporting smaller time ranges or fewer log streams at a time to see if this resolves the issue.

  6. S3 object prefix: Verify that you're looking in the correct location within the S3 bucket. The exported logs might be placed in a subfolder based on the prefix specified in the export task.

  7. CloudWatch Logs retention: Ensure that the logs haven't been deleted due to retention policies before the export task was initiated.

If the issue persists after checking these points, it would be advisable to contact AWS Support for further investigation, as there might be an underlying problem with the export process itself.
Sources
Exporting Cloudwatch log group To S3 is failing | AWS re:Post
Troubleshoot a failed export task in CloudWatch Logs | AWS re:Post

answered 9 months ago
AWS
EXPERT
reviewed 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.