{"id":17512,"date":"2021-07-17T15:19:36","date_gmt":"2021-07-17T20:49:36","guid":{"rendered":"https:\/\/www.whizlabs.com\/?p=17512"},"modified":"2021-07-18T22:03:01","modified_gmt":"2021-07-19T03:33:01","slug":"aws-cloudwatch-logs","status":"publish","type":"post","link":"https:\/\/www.whizlabs.com\/blog\/aws-cloudwatch-logs\/","title":{"rendered":"How to set up AWS CloudWatch Logs?"},"content":{"rendered":"<p><b>AWS CloudWatch Logs<\/b><span style=\"font-weight: 400;\">\u00a0intend to help developers store, access and monitor the log files within the Amazon EC2 instances. Apart from that, you can also access slog files from Route 53, AWS CloudTrail, and other such sources. But, AWS CloudWatch is most preferable with the Amazon EC2 instances.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The potential of AWS CloudWatch allows centralization of the logs from all of the apps, AWS services, and systems. One can easily view the logs, search for the errors, filter them and store them with security concerns. Not just that, but users can also query their logs, to sort them, depending upon the dimensions and specific fields. To know more about the functionality of AWS CloudWatch, refer to this article: (Link the previous article here).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But before you can utilize the functionality of AWS CloudWatch, it is important that you understand how to set it up. Therefore, this article intends to help you understand the set-up procedure for\u00a0<\/span><b>Amazon CloudWatch Logs<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ea7e02;color:#ea7e02\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ea7e02;color:#ea7e02\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.whizlabs.com\/blog\/aws-cloudwatch-logs\/#The_Initial_Set-up_of_AWS_CloudWatch_logs\" >The Initial Set-up of AWS CloudWatch logs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.whizlabs.com\/blog\/aws-cloudwatch-logs\/#Install_Configure_the_CloudWatch_Logs_Agent_on_a_Running_EC2_Linux_Instance\" >Install &amp; Configure the CloudWatch Logs Agent on a Running EC2 Linux Instance<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.whizlabs.com\/blog\/aws-cloudwatch-logs\/#Step_1_Configure_the_IAM_Role_for_the_CloudWatch_Logs\" >Step 1: Configure the IAM Role for the CloudWatch Logs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.whizlabs.com\/blog\/aws-cloudwatch-logs\/#Step_2_Install_Configure_the_CloudWatch_Logs_on_Amazon_EC2_Instance\" >Step 2: Install &amp; Configure the CloudWatch Logs on Amazon EC2 Instance<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.whizlabs.com\/blog\/aws-cloudwatch-logs\/#Setting_up_a_CloudWatch_Alarm_for_an_EC2_Instance\" >Setting up a CloudWatch Alarm for an EC2 Instance<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.whizlabs.com\/blog\/aws-cloudwatch-logs\/#Setting_up_a_Dashboard_over_AWS_CloudWatch_Logs\" >Setting up a Dashboard over AWS CloudWatch Logs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.whizlabs.com\/blog\/aws-cloudwatch-logs\/#Viewing_the_Available_CloudWatch_Log_Metrics\" >Viewing the Available CloudWatch Log Metrics<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.whizlabs.com\/blog\/aws-cloudwatch-logs\/#Creating_a_Canary_within_the_CloudWatch_Logs\" >Creating a Canary within the CloudWatch Logs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.whizlabs.com\/blog\/aws-cloudwatch-logs\/#Bottom_Line\" >Bottom Line<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"The_Initial_Set-up_of_AWS_CloudWatch_logs\"><\/span><b>The Initial Set-up of AWS CloudWatch logs<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The first thing that you need to do for using\u00a0<\/span><b>AWS CloudWatch logs<\/b><span style=\"font-weight: 400;\"> is creating an AWS account. You won&#8217;t be able to access the services and facilities of AWS without a dedicated account for the same. Creating an AWS account will allow you to use Amazon EC2, which will generate logs for you to view in the CloudWatch console.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The steps for signing up to Amazon Web Services are as follows:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/portal.aws.amazon.com\/billing\/signup#\/start\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Open this portal<\/span><\/a><span style=\"font-weight: 400;\">\u00a0to commence with the sign-up process!<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Follow the specified instructions.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Fill in the required details.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You will need to enter your phone number for account security purposes, with code verification.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Once you have created the account over AWS, you can then proceed with signing in to the AWS CloudWatch Console. Here are the steps to help you with the same:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Sign in to AWS Management Console.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open the CloudWatch console by\u00a0<\/span><a href=\"https:\/\/console.aws.amazon.com\/cloudwatch\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">clicking on this portal<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose the region where you have your AWS resources.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose logs from the navigation pane.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Moreover, you can also integrate the use of AWS CLI for performing the CloudWatch Logs operations. Follow the specified steps\u00a0<\/span><a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/cli-chap-install.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">over this link<\/span><\/a><span style=\"font-weight: 400;\">\u00a0to set up the AWS Command Line Interface.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Install_Configure_the_CloudWatch_Logs_Agent_on_a_Running_EC2_Linux_Instance\"><\/span><b>Install &amp; Configure the CloudWatch Logs Agent on a Running EC2 Linux Instance<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The developers can prefer to use the CloudWatch Logs agent installer over any of the existing EC2 instances. It is meant to install &amp; configure the CloudWatch logs agent. Once the installation is done, the logs automatically flow from the EC2 instance to the log stream. Follow these steps for the same:<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_1_Configure_the_IAM_Role_for_the_CloudWatch_Logs\"><\/span><b>Step 1: Configure the IAM Role for the CloudWatch Logs<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Access the IAM Console by logging\u00a0<\/span><a href=\"https:\/\/signin.aws.amazon.com\/signin?redirect_uri=https%3A%2F%2Fconsole.aws.amazon.com%2Fiam%2F%3Fstate%3DhashArgs%2523%26isauthcode%3Dtrue&amp;client_id=arn%3Aaws%3Aiam%3A%3A015428540659%3Auser%2Fiam&amp;forceMobileApp=0&amp;code_challenge=S4Q2vH9KC9TsEVIxPb5SL5j_oqqIwjsE9cTYrpFh3Pw&amp;code_challenge_method=SHA-256\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">onto this link<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">When you have entered the navigation pane, choose Roles.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose the Role by choosing one amongst the role names.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Please do not check the box that is next to the name of the roles.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose the &#8216;Attach Policies&#8217; tab and click on &#8216;Create Policies.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You will see a new tab opening up in your browser, or a new window will pop up.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose the JSON tab, and then you will have to type out the JSON policy document over it.<br \/>\n<\/span><\/p>\n<pre>{\r\n\"Version\": \"2012-10-17\",\r\n\"Statement\": [\r\n \u00a0{\r\n  \u00a0\u00a0\"Effect\": \"Allow\",\r\n  \u00a0\u00a0\"Action\": [\r\n  \u00a0 \u00a0\u00a0\"logs:CreateLogGroup\",\r\n  \u00a0 \u00a0\u00a0\"logs:CreateLogStream\",\r\n  \u00a0 \u00a0\u00a0\"logs:PutLogEvents\",\r\n  \u00a0 \u00a0\u00a0\"logs:DescribeLogStreams\"\r\n \u00a0],\r\n  \u00a0\u00a0\"Resource\": [\r\n  \u00a0 \u00a0\u00a0\"*\"\r\n \u00a0]\r\n}\r\n]\r\n}<\/pre>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, click on Review Policy to find any syntax errors.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Type a name and description over the &#8216;Review Policy&#8217; page for the policy that you are creating.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, review the policy summary to check on the permissions that have got a grant by the policy.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, choose &#8216;Create policy; to save the work.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, return to the &#8216;Add Permissions&#8217; page for the Role.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on &#8216;Refresh&#8217; and then choose the new policy for attaching it to your Role.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, click on &#8216;Attach Policy.&#8217;<\/span><\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Step_2_Install_Configure_the_CloudWatch_Logs_on_Amazon_EC2_Instance\"><\/span><b>Step 2: Install &amp; Configure the CloudWatch Logs on Amazon EC2 Instance<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Connect to the Amazon Linux Instance.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Update the Linux Instance for picking up all of the latest changes within the repositories.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, install the AWS logs package by following this method, &#8216;sum yum install -y awslogs.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Edit the \/etc\/awslogs\/awslogs.conf file, for configuring the logs that you wish to track.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">By default, the logs are pointed to a different region, and you can tweak the respective code to change the region.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, you need to start the awslogs service using the dedicated command.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You will then see the new log group, along with the log stream within the CloudWatch Console.<\/span><\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Setting_up_a_CloudWatch_Alarm_for_an_EC2_Instance\"><\/span><b>Setting up a CloudWatch Alarm for an EC2 Instance<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">If you have an idea about\u00a0<\/span><b>AWS CloudWatch logs<\/b><span style=\"font-weight: 400;\">, then you probably know about its feature of setting the alarm for monitoring the CloudWatch metrics for any of the select instances. By setting the alarm, CloudWatch will automatically send a notification when the select metric reaches the appointed threshold.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here are the steps that you need to follow in order to create an alarm over CloudWatch, with the use of the Amazon EC2 console. The steps are as follows:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open up the EC2 console by\u00a0<\/span><a href=\"https:\/\/console.aws.amazon.com\/ec2\/v2\/home\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">logging onto this link<\/span><\/a><span style=\"font-weight: 400;\">!<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Log onto the navigation pane, and choose instances.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select the instance, choose the &#8216;Actions, Monitor and Troubleshoot&#8217; tab and go to &#8216;Manage CloudWatch Alarms.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">On that redirected page, go to &#8216;Add or edit Alarm.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now select &#8216;Create an alarm.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now select whether you want to turn on or off the alarm notification. After that, you can go to configure Amazon SNS notifications by entering the desired SNS topic. You can select the existing topic or create a new one.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, you need to enable or disable the alarm action, to ensure the outcomes when the threshold is triggered. You will get a dropdown menu to select from.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select the criteria and metric of the alarm for setting the alarm threshold.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, choose &#8216;Create,&#8217; and your alarm is created, for instance, over CloudWatch.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">To know more about how you can use the CloudWatch alarms, visit this\u00a0<\/span><a href=\"https:\/\/docs.aws.amazon.com\/AmazonCloudWatch\/latest\/monitoring\/AlarmThatSendsEmail.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">dedicated documentation offered by AWS<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Setting_up_a_Dashboard_over_AWS_CloudWatch_Logs\"><\/span><b>Setting up a Dashboard over AWS CloudWatch Logs<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">One of the most important things within the integration of\u00a0<\/span><b>Amazon CloudWatch logs<\/b><span style=\"font-weight: 400;\"> is its dashboard. Therefore, it is important for individuals to adapt the steps of creating single or multiple dashboards. You can do it within the AWS CloudWatch console, and the steps are as follows:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Log onto your CloudWatch console by\u00a0<\/span><a href=\"https:\/\/docs.aws.amazon.com\/AmazonCloudWatch\/latest\/monitoring\/create_dashboard.html#:~:text=https%3A\/\/console.aws.amazon.com\/cloudwatch\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">logging onto this link<\/span><\/a><span style=\"font-weight: 400;\">!<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, as you are in the navigation pane, select &#8216;Dashboards,&#8217; and then go to &#8216;Create Dashboards.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Within the popped-up dialog box, you need to enter a name for the specific dashboard, and then go ahead and click on &#8216;Create Dashboard.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The name you use for creating the dashboard will appear on the CloudWatch homepage. If you are naming the dashboard in terms of the resource group, then it will appear on the homepage of CloudWatch while focusing on the resource group.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">When you are on the dialog box, after clicking on &#8216;Add to this dashboard,&#8217; you can either add graphs, add a numeral metric display, or a text block to your dashboard.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You need to select the respective tabs to add a metric graph, metric numbers, or text block to create widgets for your dashboard.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can add numeral widgets to your dashboard by further clicking on &#8216;Add Widget.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, when you are done with the inclusion of the widgets, click on &#8216;Save Dashboard.&#8217;<\/span><\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Viewing_the_Available_CloudWatch_Log_Metrics\"><\/span><b>Viewing the Available CloudWatch Log Metrics<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Metrics undergo grouping in terms of namespace and by the dimension combinations of each of them. For instance, you get the accessibility to view all of the EC2 metrics, either by themselves, grouped by Auto Scaling, or grouped by EC2 instance. The AWS services that you use are the only ones that will send metrics to AWS CloudWatch.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here are the steps that you need to follow in order to view the available metrics by dimension and namespace, with the help of the CloudWatch console. The steps are as follows:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Gain access to the CloudWatch console.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">When in the navigation menu, go ahead and choose Metrics.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select a metric namespace within the list.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, choose the metric dimension.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, go to the &#8216;All Metrics&#8217; tab. It will display all of the metrics within that dimension in the namespace.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">For sorting the table, you can use the column heading.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If you wish to graph any of the metrics, then you have to select the check box next to the metric.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can filter by resource; you need to choose the specific resource ID, go ahead and choose &#8216;Add to Search.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can filter by metric names as well.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can add the graph to the CloudWatch dashboard by selecting &#8216;Actions&#8217; and &#8216;Add to Dashboard.&#8217;<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Follow these steps, and you will be able to view and graph all of the available metrics within the CloudWatch logs.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Creating_a_Canary_within_the_CloudWatch_Logs\"><\/span><b>Creating a Canary within the CloudWatch Logs<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">CloudWatch console has a blueprint to help you create your canary. You can prefer to write your own script for the purpose. To know more about using canary blueprints,\u00a0<\/span><a href=\"https:\/\/docs.aws.amazon.com\/AmazonCloudWatch\/latest\/monitoring\/CloudWatch_Synthetics_Canaries_Blueprints.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">check out this link<\/span><\/a><span style=\"font-weight: 400;\">! But for now, learn about the steps of creating a canary with the use of AWS CloudFormation, upon using your script. The steps for creating a canary are as follows:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Access your CloudWatch Console.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to the navigation pane, and choose the option &#8216;Canaries.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, look for the tab, &#8216;Create Canary.&#8217;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, you get to choose one of the different options.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If you want to create your canary on one of the several blueprint scripts over CloudWatch, then choose &#8216;Use a Blueprint.&#8217; Following that, you can choose the type of canary that you are willing to create. (OR)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If you wish to upload a Node.js script for creating one of the custom canaries, then you need to go ahead and choose &#8216;Upload a Script.&#8217; Drag the script onto the area of &#8216;Script.&#8217; You can also choose &#8216;Browse Files&#8217; for uploading the script from your system. (OR)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If you wish to import the script from the Amazon S3 bucket, then you need to select the option, &#8216;Import from S3&#8217;. For that, you need to access the &#8216;Source Location&#8217; and enter the entire path of your canary. If not that, then you can go through the option &#8216;Browse S3&#8217;.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">After you have chosen one amongst the steps 5,6, or 7, you can now enter the name of the canary. Enter the desired name under the dedicated &#8216;Name&#8217; tab. Keep the name distinctive from all other canaries.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Under the tab, &#8216;Application or Endpoint URL,&#8217; you need to enter the URL for the canary to run its test.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Give the entry point within the Lambda Handler in case you are using your own script. Use a. handler string for the purpose.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">For the use of environment variables within your script, make sure to choose &#8216;Environment Variables&#8217; to specify a value for each space within the script.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Now, move to the scheduling part, and choose whether you have to run this new canary for once or make it run continuously with the use of a rate expression or cron expression.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Moving onto the &#8216;Data Retention tab, you need to specify the time of how long you want to retain the information for both successful and failed canary runs. This range allows you to select between 1 to 455 days.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select the S3 bucket within the &#8216;Data Storage&#8217; field.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Under the field of &#8216;Access Permissions,&#8217; choose whether you want an IAM role for running the canary or use any of the existing roles.<\/span><\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Bottom_Line\"><\/span><b>Bottom Line<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">These are a few of the set-up steps for some of the features and concepts of AWS CloudWatch. Mastering these easy steps will help you adapt the proficient use of AWS CloudWatch for monitoring the functionality of your apps and services.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Using AWS CloudWatch logs solve many queries and help you perform many actions. You can easily view the logs, search for the errors, filter them and store them with security concerns. Not just that, but users can also query their logs, to sort them, depending upon the dimensions and specific fields. So, make sure you implement them on a practical note to understand its operations.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AWS CloudWatch Logs\u00a0intend to help developers store, access and monitor the log files within the Amazon EC2 instances. Apart from that, you can also access slog files from Route 53, AWS CloudTrail, and other such sources. But, AWS CloudWatch is most preferable with the Amazon EC2 instances. The potential of AWS CloudWatch allows centralization of the logs from all of the apps, AWS services, and systems. One can easily view the logs, search for the errors, filter them and store them with security concerns. Not just that, but users can also query their logs, to sort them, depending upon the [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":79420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[4],"tags":[3945,302,3931],"class_list":["post-17512","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aws-certifications","tag-aws-online-course","tag-aws-solutions-architect-associate","tag-solution-architect-certification"],"uagb_featured_image_src":{"full":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",600,315,false],"thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log-150x150.png",150,150,true],"medium":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log-300x158.png",300,158,true],"medium_large":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",600,315,false],"large":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",600,315,false],"1536x1536":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",600,315,false],"2048x2048":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",600,315,false],"profile_24":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",24,13,false],"profile_48":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",48,25,false],"profile_96":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",96,50,false],"profile_150":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",150,79,false],"profile_300":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",300,158,false],"tptn_thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log-250x250.png",250,250,true],"web-stories-poster-portrait":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",600,315,false],"web-stories-publisher-logo":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",96,50,false],"web-stories-thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2016\/12\/How-to-set-up-AWS-CloudWatch-Log.png",150,79,false]},"uagb_author_info":{"display_name":"Pavan Gumaste","author_link":"https:\/\/www.whizlabs.com\/blog\/author\/pavan\/"},"uagb_comment_info":0,"uagb_excerpt":"AWS CloudWatch Logs\u00a0intend to help developers store, access and monitor the log files within the Amazon EC2 instances. Apart from that, you can also access slog files from Route 53, AWS CloudTrail, and other such sources. But, AWS CloudWatch is most preferable with the Amazon EC2 instances. The potential of AWS CloudWatch allows centralization of&hellip;","_links":{"self":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/17512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/comments?post=17512"}],"version-history":[{"count":4,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/17512\/revisions"}],"predecessor-version":[{"id":79422,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/17512\/revisions\/79422"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/media\/79420"}],"wp:attachment":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/media?parent=17512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/categories?post=17512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/tags?post=17512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}