how to monitor each request and response in cloudfront?
0
I need to save this information as downloaded and uploaded headers and data and save to dynamodb or s3
asked 2 months ago38 views
2 Answers
0
Hi there. I am not sure if this satisfies your needs or not, but you can use a CloudFront function on the viewer response and inspect the event object. Doing a simple console.log(JSON.stringify(event))
will log the entire event object, which includes the request and response headers. From there, you can view the logs in CloudWatch logs.
answered 2 months ago
0
There are a few options that might be useful.
- Enable CloudFront logging - This will just generate the standard access logs and drop them in S3. I am not sure if these access logs contain the specific data you are looking for.
- Enable Real-Time logs - There are a few options here, but one of the most common is to use Kinesis to send a log stream to a service like AWS OpenSearch or even S3. Like option 1, I don't know if this will contain the specific data you are looking for.
- CloudWatch logs - This is the option I mentioned in my original answer. If you are trying to get the log data from CloudWatch into S3 then it is possible to export the CloudWatch logs into S3, or automate that process using a subscription to invoke a Lambda to perform the export.
If your goal is to get the request/response data into S3, then I think option 3 is the best bet, since I am not certain if the log files in options 1/2 contain the specific data you are looking for.
answered 2 months ago
Relevant questions
how to monitor each request and response in cloudfront?
asked 2 months agoHow to use Amplify Datastore to sync with data from DynamoDB and seed DynamoDB from a Lamba
asked 5 months agoDynamoDB: Duplicate a lot of data to save a second lookup?
asked 3 months agoPossible to save Honeycode data directly to Dynamodb
asked 4 months agoLambda response compression to API Gateway and client
asked 5 months agoI need to read S3 data, transform and put into Data Catalog. Should I be using a Crawler?
Accepted Answerasked 3 months agoSave Data for Script Canvas?
Accepted Answerasked a year agoUsing AWS Lambda to run Python script, how can I save data?
Accepted Answerasked 3 years agosave logs of each outbound data transfer response from cloudfront to s3
asked 2 months ago[AI/ML] Data acquisition and preprocessing
Accepted Answerasked 2 years ago
is there any way to monitor input/output transfer data on each response and save that information to s3?