1 00:00:00,180 --> 00:00:01,800 ‫So here is a short lecture 2 00:00:01,800 --> 00:00:03,960 ‫on real-time logs in CloudFront. 3 00:00:03,960 --> 00:00:07,140 ‫So it's possible for you to get all the requests 4 00:00:07,140 --> 00:00:10,980 ‫that are received by CloudFront to be sent in real time 5 00:00:10,980 --> 00:00:12,900 ‫to a Kinesis Data Stream. 6 00:00:12,900 --> 00:00:15,810 ‫The goal of this is, for example, to monitor, analyze, 7 00:00:15,810 --> 00:00:19,410 ‫and take actions based on content delivery performance. 8 00:00:19,410 --> 00:00:21,390 ‫So just to give you an overview, 9 00:00:21,390 --> 00:00:24,060 ‫the users are going to do a lot of requests into CloudFront 10 00:00:24,060 --> 00:00:26,100 ‫and then if you enable the real-time logs, 11 00:00:26,100 --> 00:00:28,140 ‫all these requests are going to be logged into 12 00:00:28,140 --> 00:00:29,340 ‫a Kinesis Data Stream. 13 00:00:29,340 --> 00:00:30,570 ‫And then, for example, 14 00:00:30,570 --> 00:00:33,690 ‫you can use a Lambda function to process these records 15 00:00:33,690 --> 00:00:35,400 ‫from your Kinesis Data Stream. 16 00:00:35,400 --> 00:00:37,710 ‫If you need to do near real-time processing, 17 00:00:37,710 --> 00:00:39,270 ‫you will do the exact same first part, 18 00:00:39,270 --> 00:00:42,090 ‫because CloudFront can only send to Kinesis Data Stream, 19 00:00:42,090 --> 00:00:44,430 ‫but then you would use Kinesis Data Firehose 20 00:00:44,430 --> 00:00:46,710 ‫to process these records by batches 21 00:00:46,710 --> 00:00:50,160 ‫and maybe send them into Amazon S3 or Open Search, 22 00:00:50,160 --> 00:00:52,890 ‫or whatever destination you may have in mind. 23 00:00:52,890 --> 00:00:55,680 ‫So this allows you to choose, as well, the sampling rate, 24 00:00:55,680 --> 00:00:58,560 ‫which is the percentage of the request you want to receive 25 00:00:58,560 --> 00:00:59,970 ‫in your Kinesis Data Stream. 26 00:00:59,970 --> 00:01:03,690 ‫Because if you have a very high traffic type of API 27 00:01:03,690 --> 00:01:06,360 ‫or endpoint, you may not want to have all requests in there, 28 00:01:06,360 --> 00:01:07,650 ‫just a sample. 29 00:01:07,650 --> 00:01:09,900 ‫And also, you can specify which fields 30 00:01:09,900 --> 00:01:12,390 ‫and which cache behaviors or path patterns 31 00:01:12,390 --> 00:01:15,060 ‫you want to have access to in your Kinesis Data Stream. 32 00:01:15,060 --> 00:01:17,352 ‫So for example, you say, "Hey, I only wanna have 33 00:01:17,352 --> 00:01:20,850 ‫(indistinct) slash images type of cache behavior, 34 00:01:20,850 --> 00:01:22,500 ‫because I just wanna see the request done 35 00:01:22,500 --> 00:01:24,660 ‫to this path specifically." 36 00:01:24,660 --> 00:01:26,010 ‫Okay, that's it for this lecture. 37 00:01:26,010 --> 00:01:29,073 ‫I hope you liked it and I will see you in the next lecture.