【以下的问题经过翻译处理】 你好:
我正在尝试从AWS IoT插入数据到Timestream,我创建了下面的规则:
SELECT * FROM 'dataTopic'
ACTIONS:
将消息写入Timestream:
数据库:test,
表: sensors,
维度名:device,
维度值:${device}
将消息转发到AWS IoT主题:test
错误操作:
将消息转发到AWS IoT主题:error
然后以如下方式发布数据:
{
"device": "abc123",
"temperature": "24.50",
"humidity": "49"
}
效果很好。
现在,我的真实数据 实际上是这样的:
{
"state": {
"reported": {
"device": "abc123",
"temperature": "24.50",
"humidity": "49"
}
}
}
所以我不得不修改我的规则为:
SELECT state.reported.* FROM 'dataTopic'
但是当我测试它时,我从Timestream得到了一个错误,看起来是这样的:
"failures" : [ {
"failedAction" : "TimestreamAction",
"failedResource" : "test#sensors",
"errorMessage" : "Failed to write records to Timestream. The error received was 'Errors at dimensions.0: [Dimension value can not be empty.]'. Message arrived on dataTopic, Action: timestream, Database: test, Table: sensors"
但是,检查主题测试接收的数据时,我没有看到与原始数据的差异:
{
"device" : "abc123",
"temperature" : "24.50",
"humidity" : "49"
}
问题可能是什么?到目前为止,我看到相同的数据被接收,但是出于某种原因,Timestream看到的情况不同。我尝试使用Cloudwatch查看Timestream实际接收到的内容,但我无法从这个