aws iot sql like

0

SELECT clientId() as clientId, CASE clientId() WHEN 'bus_#' THEN 'bus' WHEN 'car_#' THEN 'car' ELSE 'noThingType' END as thingType FROM '$aws/events/#'

clientId : bus_001, bus_002, car_aaa, car_bbb

You can search the connection history through AWS IoT SQL: FROM '$aws/events/#'. The clientId is fixed in the front and variable in the back. I want to look up thingType by looking at clientId. Is there an AWS IoT SQL that behaves like MySQL? please answer about my question. Thanks in advance.

asked 3 months ago114 views
1 Answer
0

Hi. The startswith() or substring() functions may be of interest.

Alternatively you might consider to use a Lambda to process the events, particularly if you've used registry thing types.

profile pictureAWS
EXPERT
Greg_B
answered 3 months ago
  • answer thank you. clientId random string. example) train_001, airport_111, ... So. startwith() or substring() function cannot be used.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions