EMQX规则引擎命中不了数据

数据体如下,
{
“message”: {
“header”: {
“version”: “V1.0.0”,
“ts”: “2023-09-14 16:23:54”,
“index”: 195,
“function”: “pmMsgReq”
},
“dataBody”: [
{
“pmAddr”: “pm0_1”,
“fTotalActEng”: “130689”,
“rTotalActEng”: “14”,
“aVolt”: “226.4”,
“bVolt”: “225.9”,
“cVolt”: “229.2”,
“aCurr”: “273.6”,
“bCurr”: “340.8”,
“cCurr”: “187.2”,
“fre”: “49.96”,
“totalActPwr”: “163.4”,
“totalReactPwr”: “40.8”,
“totalPSPwr”: “168.3”,
“totalFactPwr”: “0.97”,
“topFActEng”: “0”,
“peakFActEng”: “0”,
“flatFActEng”: “0”,
“valleyFActEng”: “0”,
“topRActEng”: “0”,
“peakRActEng”: “0”,
“flatRActEng”: “0”,
“valleyRActEng”: “0”
},
{
“pmAddr”: “pm0_2”,
“fTotalActEng”: “”,
“rTotalActEng”: “”,
“aVolt”: “”,
“bVolt”: “”,
“cVolt”: “”,
“aCurr”: “”,
“bCurr”: “”,
“cCurr”: “”,
“fre”: “”,
“totalActPwr”: “”,
“totalReactPwr”: “”,
“totalPSPwr”: “”,
“totalFactPwr”: “”,
“topFActEng”: “”,
“peakFActEng”: “”,
“flatFActEng”: “”,
“valleyFActEng”: “”,
“topRActEng”: “”,
“peakRActEng”: “”,
“flatRActEng”: “”,
“valleyRActEng”: “”
},
{
“pmAddr”: “pm0_5”,
“fTotalActEng”: “31326”,
“rTotalActEng”: “26019”,
“aVolt”: “227.3”,
“bVolt”: “227.1”,
“cVolt”: “230.2”,
“aCurr”: “144.3”,
“bCurr”: “145.5”,
“cCurr”: “142.5”,
“fre”: “49.96”,
“totalActPwr”: “-97.8”,
“totalReactPwr”: “-1.5”,
“totalPSPwr”: “97.8”,
“totalFactPwr”: “0.00”,
“topFActEng”: “157”,
“peakFActEng”: “675”,
“flatFActEng”: “5”,
“valleyFActEng”: “30489”,
“topRActEng”: “25910”,
“peakRActEng”: “109”,
“flatRActEng”: “0”,
“valleyRActEng”: “0”
}
]
}
}

sql如下:
SELECT
*
FROM
“/device/data/”
WHERE payload.message.header.function=‘pmMsgReq’


复制了你的数据试了一下,是可以的。

解决了,这块有bug,where后面的条件需要双引号括起来,但是测试可以获取到数据。