SelectAttributes 活动 - Amazon IoT Analytics
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

SelectAttributes 活动

selectAttributes 活动仅使用原始消息中的指定属性创建新消息。其他属性都将被丢弃。selectAttributes 只会在消息的根位置下创建新属性。因此,给定此消息:

{ "device": { "id": "device-123", "coord": [ 47.6152543, -122.3354883 ], "temp": 50, "hum": 40 }, "light": 90 }

和此活动:

{ "selectAttributes": { "name": "MySelectAttributesActivity", "attributes": [ "device.temp", "device.hum", "light" ], "next": "MyDatastoreActivity" } }

结果是以下消息流经管道。

{ "temp": 50, "hum": 40, "light": 90 }

同样,selectAttributes 只能创建根级别对象。