SelectAttributes activity - Amazon IoT Analytics
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).

End of support notice: On December 15, 2025, Amazon will end support for Amazon IoT Analytics. After December 15, 2025, you will no longer be able to access the Amazon IoT Analytics console, or Amazon IoT Analytics resources. For more information, visit this Amazon IoT Analytics end of support.

SelectAttributes activity

The selectAttributes activity creates a new message using only the specified attributes from the original message. Every other attribute is dropped. selectAttributes creates new attributes under the root of the message only. So given this message:

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

and this activity:

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

The result is the following message flowing through the pipeline.

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

Again, selectAttributes can only create root-level objects.