Monitor Amazon IoT using CloudWatch Logs - Amazon IoT Core
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Monitor Amazon IoT using CloudWatch Logs

When Amazon IoT logging is enabled, Amazon IoT sends progress events about each message as it passes from your devices through the message broker and rules engine. In the CloudWatch console, CloudWatch logs appear in a log group named AWSIotLogs.

For more information about CloudWatch Logs, see CloudWatch Logs. For information about supported Amazon IoT CloudWatch Logs, see CloudWatch Logs Amazon IoT log entries.

Viewing Amazon IoT logs in the CloudWatch console

Note

The AWSIotLogsV2 log group is not visible in the CloudWatch console until:

  • You've enabled logging in Amazon IoT. For more info on how to enable logging in Amazon IoT, see Configure Amazon IoT logging

  • Some log entries have been written by Amazon IoT operations.

To view your Amazon IoT logs in the CloudWatch console
  1. Browse to https://console.amazonaws.cn/cloudwatch/. In the navigation pane, choose Log groups.

  2. In the Filter text box, enter AWSIotLogsV2 , and then press Enter.

  3. Double-click the AWSIotLogsV2 log group.

  4. Choose Search All. A complete list of the Amazon IoT logs generated for your account is displayed.

  5. Choose the expand icon to look at an individual stream.

You can also enter a query in the Filter events text box. Here are some interesting queries to try:

  • { $.logLevel = "INFO" }

    Find all logs that have a log level of INFO.

  • { $.status = "Success" }

    Find all logs that have a status of Success.

  • { $.status = "Success" && $.eventType = "GetThingShadow" }

    Find all logs that have a status of Success and an event type of GetThingShadow.

For more information about creating filter expressions, see CloudWatch Logs Queries.