Live Tail feature for Amazon CloudWatch Logs

Myron Zaiets
Terraform/AWS tips
Published in
3 min readJun 18, 2023

Hi,

Amazon CloudWatch Logs is a service provided by Amazon Web Services (AWS) that allows you to monitor, store, and access log files from various AWS resources and applications. The Live Tail feature in CloudWatch Logs allows you to view real-time log data as it is being generated, making it easier to monitor and debug your applications.

AWS just announced this feature, and you can check more by visiting this blog: https://aws.amazon.com/blogs/mt/announcing-live-tail-feature-for-amazon-cloudwatch-logs/

I wanted to test it myself, and here is what I discovered.

When you open CloudWatch, you will see a feature called Live Tail.

You can choose the log group you want to analyze and click start tailing.

Here is the main menu, you can choose log groups, log streams, and also use some filter patterns. Sounds exciting :))

OK, let’s test it.

Forgot to say about pricing, as per AWS — https://aws.amazon.com/cloudwatch/pricing/, you are paying per minute the tail feature is used. (see EXAMPLE 6)

Let’s come back to our test case.

  1. I created some lambda that creates our S3 bucket:

2. Let’s test it by using the Live Tail feature, I will run a lambda function now. As you can see, I started a log monitoring:

3. After a few minutes, I can see some logs appearing:

We have an error here. If I want to see just an ERROR, I will add a filter:

You can also choose different filter patterns under the Filter Patterns block.

Now we have just the ERROR message, so we can simply see what is wrong with our lambda. Error is trivial as the bucket name already exists.

4. Let’s fix the error by changing the bucket name.

Conclusion

It is a very interesting feature as we can debug errors live from different services. Also, we can tail logs from different AWS-managed services, that are pushing logs to CloudWatch (EKS, Route 53, etc…).

As per my last screen, we can also see the direct links to the Log Streams, also by using Actions we can download logs in JSON, CSV, and XLSX.

Thank you and have a nice day.

See you next time.😉

--

--