Ends in
00
days
00
hrs
00
mins
00
secs
ENROLL NOW

Get $4 OFF in AWS Solutions Architect & Data Engineer Associate Practice Exams for $10.99 each ONLY!

Adding Logs Insights Queries To Your CloudWatch Dashboard

Introduction

Widgets are the building blocks of a CloudWatch dashboard. They come in various types that can help you interpret metrics in a way that’s not only meaningful but also tailored to your specific needs. While they are typically used for visualizing metrics, widgets can also display the results of Logs Insights queries on your dashboard.

Adding Logs Insights Queries To Your CloudWatch Dashboard

Logs Insights queries as a checklist

You can save Logs Insights queries to create a “troubleshooting checklist” for various situations. For example, if there’s a sudden increase in your application’s load, you might wanna check your logs first for any high number of requests, latency issues, or perhaps a high rate of unauthorized attempts. This can save you time in diagnosing issues. By displaying your “troubleshooting checklist” in a dashboard, you can do even better!

In this post, I’ll walk you through the steps of adding a CloudWatch widget out of Logs Insights query results. Our objective is to show the highest number of requests by IP address, as shown below.

Adding Logs Insights Queries To Your CloudWatch Dashboard

Steps

  1. Open the Amazon CloudWatch Dashboard and click on the + icon.
  2. Select the Logs table widget and click Next.
  3. Choose the Log group that contains the data you want to display.
  4. Copy the following query and paste it into the text area.
Tutorials dojo strip

 

On line 5, we’re excluding the server’s IP, so it won’t show up in the results. We do this since we’re only interested in reviewing user requests, not internal ones made by our server. Additionally, You might want to filter out other legitimate traffic sources, such as Googlebot crawlers or Route 53 health checkers.

        5. Finally, click Create widget.

The beauty of adding queries to your dashboard is that it’s like CloudWatch is running the queries for you. To see updated results, you can simply refresh the widget whenever you want. You can also view the results at different timeframes. For instance, if you wish to see the top requesting IP addresses for the past five minutes, you can configure the Relative time and set it to five minutes. Please note that queries run each time you load the dashboard or refresh it. Additionally, running queries are not free, so you may want to avoid refreshing the dashboard frequently, especially at higher timeframes. The query results are limited to 1,000 entries, and those at the bottom may not be of use to you, so you can add a filter to the query that limits the returned entries.

Conclusion:

That’s it. I hope you were able to follow this simple tutorial. Thank you for coming by.

 

Get $4 OFF in AWS Solutions Architect & Data Engineer Associate Practice Exams for $10.99 ONLY!

Tutorials Dojo portal

Be Inspired and Mentored with Cloud Career Journeys!

Tutorials Dojo portal

Enroll Now – Our Azure Certification Exam Reviewers

azure reviewers tutorials dojo

Enroll Now – Our Google Cloud Certification Exam Reviewers

Tutorials Dojo Exam Study Guide eBooks

tutorials dojo study guide eBook

FREE AWS Exam Readiness Digital Courses

Subscribe to our YouTube Channel

Tutorials Dojo YouTube Channel

FREE Intro to Cloud Computing for Beginners

FREE AWS, Azure, GCP Practice Test Samplers

Recent Posts

Written by: Carlo Acebedo

Carlo is a cloud engineer and a content creator at Tutorials Dojo. He's also a member of the AWS Community builder and holds 5 AWS Certifications. Carlo specializes in building and automating solutions in the Amazon Web Services Cloud.

AWS, Azure, and GCP Certifications are consistently among the top-paying IT certifications in the world, considering that most companies have now shifted to the cloud. Earn over $150,000 per year with an AWS, Azure, or GCP certification!

Follow us on LinkedIn, YouTube, Facebook, or join our Slack study group. More importantly, answer as many practice exams as you can to help increase your chances of passing your certification exams on your first try!

View Our AWS, Azure, and GCP Exam Reviewers Check out our FREE courses

Our Community

~98%
passing rate
Around 95-98% of our students pass the AWS Certification exams after training with our courses.
200k+
students
Over 200k enrollees choose Tutorials Dojo in preparing for their AWS Certification exams.
~4.8
ratings
Our courses are highly rated by our enrollees from all over the world.

What our students say about us?