简体   繁体   English

AWS IoT SQL 规则

[英]AWS IoT SQL Rule

Am trying to execute the IoT Rule as part of the CFT template.我正在尝试将 IoT 规则作为 CFT 模板的一部分执行。 This rule has to ignore the message which has this field sNumber starting with F0F1.该规则必须忽略具有以 F0F1 开头的字段 sNumber 的消息。 The rule is like规则就像

SELECT * FROM 'topic/+/+/+' WHERE 'sNumber' NOT LIKE 'F0F1%'

But, am facing this error:但是,我面临这个错误:

Resource handler returned message: "Expected a comparison operation: StringNode(sNumber) 'sNumber' NOT LIKE 'F0F1%' --------------------------------------------------------------------------------------------------------------------------------^ at 1:34 (Service: Iot, Status Code: 400, Request ID: 75e91f11-05c8-4e22-8cd7-0a3567261695, Extended Request ID: null)" (RequestToken: 6cd8d39d-1b2d-4076-6253-60212009a63a, HandlerErrorCode: InvalidRequest)资源处理程序返回消息:“预期比较操作:StringNode(sNumber) 'sNumber' NOT LIKE 'F0F1%' -------------------------- ---------------------------------------------- ---------------------------------------------- --^ 在 1:34(服务:Iot,状态代码:400,请求 ID:75e91f11-05c8-4e22-8cd7-0a3567261695,扩展请求 ID:null)”(RequestToken:6cd8d39d-1b2d-4076-6253-60212009a63a,处理程序错误代码:无效请求)

Can you help me understand what need to be done to achieve my requirement.你能帮我理解需要做什么才能达到我的要求吗?

Try using startswith() function尝试使用 startswith() function

SELECT * FROM 'topic/+/+/+' WHERE NOT startswith(sNumber, 'F0F1')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM