| by Arround The Web | No comments

How to Get Logs From AWS Stack

AWS Stack is an AWS CloudFormation service that creates a single unit by collecting multiple AWS resources. The stack can be then used to manage all those resources combined. You can get logs of the AWS stack to analyze and collect its data.

This post will provide a procedural guide to teach how to get logs from AWS Stack, so to get logs from a stack, you need a stack. You can create a stack using CloudFormation and Cloud9. In this post, Cloud9 will be used.

Stack Creation Using Cloud9

To Create a stack, let’s create an environment with an EC2 instance, by searching Account Environment, and clicking on it:


Click on the Create environment button:


Create environment wizard will open, provide a name for Environment and select Environment type as New EC2 instance:


Select the options for the new EC2 instance as per your preference:


Leave the rest of the settings as default and click on the Create button:


A success message will display on the creation of the environment:


The next step is to see the stack created by this environment so search stack and click on CloudFormation:


Click on Stacks to see the stack that is created automatically after the successful creation of Environment:

Get Logs From AWS Stack

You can get all Log Streams of the AWS Stack and even logs of a particular resource from the AWS Stack.

Get Logs of a Particular Resource of the AWS Stack

In the Stacks dashboard, you can see the available stack:


To open its details, click on Stack name:


Select the Resources tab, To get the log of a particular resource, select the resource:


Click on its Physical ID:


It will open a new wizard, select the instance and open the Actions list, and click on the Get system log from the Monitor and troubleshoot option:


In the Get system log wizard, logs will appear with the available options, copy log, and Download:


Note: You successfully got the logs of a particular resource from the stack.

Get logs of all Log Streams of the AWS Stack

Go to the Stacks dashboard and open the Stack actions drop-down list, and click on View in Application Manager option:


Go to the Logs tab:


The log groups wizard will open containing the groups of logs, select a log group:


Click on the button Search all log streams:


It will provide logs, with the facility of filtering:


You can use these logs to analyze the data and make decisions based on them.

Conclusion

To get logs from AWS Stack, go to the stack dashboard and open stack details, now if you want to get logs of a particular resource, select the resource and use the option Get system log from the actions list. If you want to get all log streams of the AWS Stack, go to log groups and select the option to search all log streams.

Share Button

Source: linuxhint.com

Leave a Reply