1
00:00:00,390 --> 00:00:07,200
In this video, we are going to see a lot of the invocation logs from the Amazon cloud logs using to

2
00:00:07,620 --> 00:00:08,670
select commands.

3
00:00:08,910 --> 00:00:14,880
So far we have checked the looks from the main console, but we can also check from the command line

4
00:00:14,880 --> 00:00:17,160
with using the same commands.

5
00:00:17,970 --> 00:00:19,290
Let's get started.

6
00:00:19,770 --> 00:00:26,030
Before we start, we can check the reference documentation about the logs on the fly.

7
00:00:26,160 --> 00:00:31,890
You can use these links on the lecture 51 commands x file here.

8
00:00:31,890 --> 00:00:36,970
You can find the logs description, documentation from the command line reference.

9
00:00:36,990 --> 00:00:41,920
If you scroll down under the logs, we have some available commands that we can use.

10
00:00:41,940 --> 00:00:48,330
During this video, I will use the describe log groups we can see in here, describe log groups and

11
00:00:48,330 --> 00:00:50,300
also we will use get log events.

12
00:00:50,310 --> 00:00:56,970
You can either see the get log events if you open these describe log groups, you can see the options

13
00:00:56,970 --> 00:00:59,990
and configurations, an example usage in here.

14
00:01:00,000 --> 00:01:05,070
And also if you see the get log events, you can see the options and configurations and you can see

15
00:01:05,070 --> 00:01:06,660
the example commands in here.

16
00:01:06,810 --> 00:01:09,810
Okay, let's get start for our example.

17
00:01:09,840 --> 00:01:19,230
Open the code and in here I'm going to use an invocation logs from the our last created lambda function,

18
00:01:19,230 --> 00:01:23,160
which is the ADA, which is my function to for that purpose.

19
00:01:23,160 --> 00:01:24,780
We have several steps.

20
00:01:24,780 --> 00:01:29,160
If you come here, you can see the first step is get the log group name.

21
00:01:29,160 --> 00:01:32,490
So I'm going to get logged group name with these commands.

22
00:01:32,520 --> 00:01:36,270
First of all, I would like to say that I'm using multi-line character for Windows.

23
00:01:36,270 --> 00:01:41,520
If you are using the Mac or Linux, you can change these escape character with this one.

24
00:01:41,850 --> 00:01:45,660
Okay, let me copy this first command and paste in here.

25
00:01:45,660 --> 00:01:46,860
Hit the enter.

26
00:01:46,890 --> 00:01:48,690
You can see that here.

27
00:01:48,690 --> 00:01:54,570
There is some a lambda functions and get the log names in here.

28
00:01:54,570 --> 00:02:02,220
I have very big list, but the idea is that we are going to check the logs for the my function tool

29
00:02:02,610 --> 00:02:09,810
because we have just created this function so you can get the name from these describe log groups command.

30
00:02:09,810 --> 00:02:15,660
And after that we will list the log stream for that locker room for that action.

31
00:02:15,660 --> 00:02:23,640
I'm going to copy this command, which is the logs describe log stream and pasting the log name as our

32
00:02:23,640 --> 00:02:28,050
function, which is the alias slash lambda slash my function to.

33
00:02:29,170 --> 00:02:35,890
And here you can paste this command into the PowerShell command line window and hit enter.

34
00:02:35,950 --> 00:02:40,660
So this time we will see the log stream names in here.

35
00:02:40,750 --> 00:02:50,290
So after that, after we grabbing getting these log stream names, now we can get log events from the

36
00:02:50,740 --> 00:02:52,450
particular logs that remain.

37
00:02:52,540 --> 00:03:00,190
For that purpose, we have one more command, which is the alias logs, get the log dash events command

38
00:03:00,310 --> 00:03:06,880
and we are going to pass log name as my dash function tool and logs it in the name you can copy from

39
00:03:06,880 --> 00:03:11,470
the last one and paste as the log stream name.

40
00:03:11,710 --> 00:03:20,470
And now we are ready to get the logs from the latest log stream name and paste the command in here.

41
00:03:20,630 --> 00:03:21,670
Hit the enter.

42
00:03:22,950 --> 00:03:26,610
And you can see the response is coming as expected.

43
00:03:26,640 --> 00:03:34,980
If you come the latest line of code and scroll up, you can see that we have events.

44
00:03:36,110 --> 00:03:36,590
El Rey.

45
00:03:36,590 --> 00:03:39,650
And in these events, El Rey, we have several looks.

46
00:03:39,650 --> 00:03:41,060
This is the start.

47
00:03:41,060 --> 00:03:47,730
Look, as you can see that start request ID and this is the second log which is the logging, the incoming

48
00:03:47,730 --> 00:03:50,030
command, you can see the increment event.

49
00:03:50,030 --> 00:03:53,540
JSON is a JSON format key and value.

50
00:03:53,570 --> 00:03:58,160
And if you scroll down, you can see the latest log which is the and request log.

51
00:03:58,460 --> 00:04:04,910
So if you check the second look, this is the important one, you will see the incoming event JSON object.

52
00:04:05,060 --> 00:04:11,000
We can also verify from the list management console cloud which logs that we can already do.

53
00:04:11,000 --> 00:04:14,300
In the last video you can see that in the cloud watch logs.

54
00:04:14,300 --> 00:04:17,270
We can get these logs from the commands.

55
00:04:18,440 --> 00:04:25,100
As you can see that we can take a lambda invocation logs from the Amazon cloud logs using the same commands.
