Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Using the Amazon CloudWatch Logs query editor

Focus mode
Using the Amazon CloudWatch Logs query editor - Amazon Managed Grafana

To query CloudWatch Logs, select the Region and up to 20 log groups that you want to query. Use the main input area to write your query. For more information, see CloudWatch Logs Insights query syntax.

You can also write queries returning time series data by using the stats command in CloudWatch Logs Insights. When making stats queries in Explore, you have to make sure you are in Metrics Explore mode.

To the right of the query input field is a CloudWatch Logs Insights link that opens the CloudWatch Logs Insights console with your query. You can continue exploration there if necessary.

Using template variables

As with several other data sources, the CloudWatch data source supports the use of template variables in queries. For more information, see Templates and variables.

Deep linking from Grafana panels to the CloudWatch Logs console

If you want to view your query in the CloudWatch Logs Insights console, choose the CloudWatch Logs Insights button next to the query editor. If you’re not currently signed in to the CloudWatch console, the link forwards you to the sign-in page. The provided link is valid for any AWS account but only displays the correct metrics if you’re signed in to the AWS account that corresponds to the selected data source in Grafana.

Alerting

Because CloudWatch Logs queries can return numeric data, for example, through the use of the stats command, alerts are supported. For more information, see Grafana alerting.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.