Skip to content

IoT Core CloudWatch rule

0

Hi,

We're going to store IoT things/devices logs in CloudWatch, so we've created an IoT rule to store messages from dedicated topic into CloudWatch. Every time the rule is triggered a new CloudWatch stream is created. It has a name in form of "<RULE_NAME>-123456789". It seems that it will be thousands or millions of streams created. Is it expected behavior? Doesn't look like really convenient for usage. Is it possible to store logs using stream-per-device design? Or maybe another approach for structuring device logs in CloudWatch?

BR

  • I'm facing the same dilema

1 Answer
0

Hello

Yes you can create log stream per IOT thing. I posted a few articles that details how to do so below. You can also set logging per device even if devices are not registered as an IOT Thing. This is described in this post.

In AWS IoT, you can configure resource-specific logging using the CLI to set logging levels for individual thing groups (as detailed here). Thing groups can be nested, allowing logging settings to apply hierarchically, with child groups able to override parent configurations. A thing inherits settings, policies, and logging levels from the groups it belongs to, provided the client ID matches the thing name (or via exclusive thing attachment otherwise). Beyond thing groups, logging can also target resources such as client IDs, source IPs, and principal IDs.

When your client ID matches the thing name, AWS IoT Core will automatically associate the client session with the corresponding thing resource. This allows the client session to inherit the configurations and settings applied to the thing groups to which the thing belongs, **including the logging levels. **

Hope this helps,

Here are some interesting articles on this topic : https://repost.aws/knowledge-center/aws-iot-core-manage-logging-levels https://repost.aws/knowledge-center/aws-iot-core-configure-manual-logging https://repost.aws/knowledge-center/aws-iot-core-configure-dynamic-logging

AWS
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.