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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With