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
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
-
Browse to https://console.amazonaws.cn/cloudwatch/
. In the navigation pane, choose Log groups. -
In the Filter text box, enter
AWSIotLogsV2
, and then press Enter. -
Double-click the
AWSIotLogsV2
log group. -
Choose Search All. A complete list of the Amazon IoT logs generated for your account is displayed.
-
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 ofGetThingShadow
.
For more information about creating filter expressions, see CloudWatch Logs Queries.