【问题标题】:Unable to send aws iot mqtt messages into aws kinesis firehose in a batch mode无法以批处理模式将 aws iot mqtt 消息发送到 aws kinesis firehose
【发布时间】:2021-10-22 07:12:41
【问题描述】:

这是我的 mqtt 负载

{   "type": "1",   "data": [
    {
      "customer_org_id": "777233",
      "vdms_id": "2",
      "vendor_id": "2",
      "remote_session_type": "open",
      "timestamp": "125434115",
      "email": "rajweeeeeath@acdercessonline.io",
      "network": "iptv"
    },
    {
      "customer_org_id": "555777233",
      "vdms_id": "5552",
      "vendor_id": "5552",
      "remote_session_type": "555open",
      "timestamp": "1255555434115",
      "email": "rajweeeeeat5555h@acdercessonline.io",
      "network": "iptv5555"
    }   ] }

这是我的 iot Sql 规则

SELECT (select * from data) AS messages FROM 'test/fairfield' where type = '1'

我正在尝试生成一个 json 数组,以便我可以在批处理模式下将其摄取到 kinesis firehose 中。 但是,我收到一条错误消息

"errorMessage": "Failed to send message to Firehose. The error received was The payload must be a valid json array when batchMode=true, e.g. '[\"a\", \"b\", \"c\"]'. Message arrived on: test/fairfield

注意:我什至尝试从 'test/fairfield' 中选择数据,其中 type = '1' 但是,我得到了同样的错误。 在这里的任何帮助将不胜感激。

【问题讨论】:

    标签: aws-iot amazon-kinesis-firehose


    【解决方案1】:

    我认为以下规则发挥了魔力,这是新 sql 版本 2016-03-23 的一部分

    SELECT VALUE data FROM 'test' where type = '1'
    

    但是,我仍然想知道,我们是否可以选择数组中每个对象的特定元素并重命名键。

    【讨论】:

      猜你喜欢
      • 2018-11-26
      • 1970-01-01
      • 2017-02-22
      • 2020-12-29
      • 2016-04-05
      • 2019-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多