Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudwatch log service combining logs

I'm looking at this guide for configuring log services on a linux AWS machine. If I wanted to view logs from different machines, would all the logs show up in one place in my console or do I have to go to each machine separately. On a smaller scale, can I search logs by specific files I listed to keep track of logs from?

like image 961
MarksCode Avatar asked Aug 17 '16 22:08

MarksCode


People also ask

How do you aggregate CloudWatch logs?

To run a query with an aggregation functionIn the navigation pane, choose Logs, and then choose Logs Insights. In the Select log group(s) drop down, choose one or more log groups to query. You can enter the name of log groups that you want to query in the search bar.

How do you make a CloudWatch log group?

To create a log groupOpen the CloudWatch console at https://console.aws.amazon.com/cloudwatch/ . In the navigation pane, choose Log groups. Choose Actions, and then choose Create log group. Enter a name for the log group, and then choose Create log group.

Does CloudWatch agent create log group?

Before a log event can be published, you must create a log group and log stream. If there's no log group or log stream, the CloudWatch agent creates them.


1 Answers

The correct way to search the logs over multiple instances would be to hit the "Search Group" button after you click on the Log Group. This will collate the various log streams.

Continue to use the instance id/name as the log stream.

The previous answer is incorrect, and will cause issues related to sequencing of logs and idempotency. This includes the possibility of an losing logs if 5 requests with an invalid sequence token occur in a row.

like image 164
Matt Avatar answered Sep 28 '22 04:09

Matt