'AWS Lamda Error: Parsing error: Unexpected token client

First-time Lambda user

I'm trying to get an IOT device payload from IOT Core to a GraphQL endpoint by using an 'Act' with a Lambda function on IOT Core.

I found the below tutorial online and tailored it to my needs but I get a "Parsing error: Unexpected token client" error.

https://aws.amazon.com/blogs/mobile/iot-with-aws-appsync/

I have also included the SQL statement used to select the data from the IOT Payload

SELECT 
dev_id AS trackerID,
timestamp() AS time, 
parse_time("MM.dd.yyyy HH:mm:ss z", timestamp(), "Europe/Belfast") AS date_time, 
counter, 
payload_fields.gps_1.altitude AS altitude, 
payload_fields.gps_1.latitude AS latitude, 
payload_fields.gps_1.longitude AS longitude, 
payload_fields.analog_in_5 AS batt, 
payload_fields.analog_in_6 AS kmph, 
payload_fields.analog_in_7 AS hdop,  
hardware_serial, 
metadata 
FROM '#'

and a screenshot of the Lambda function

Lambda function screenshot

Any assistance or suggestions would be appreciated!!!



Solution 1:[1]

I dont think mm.dd.yyyy is valid date format in SQL...try to use a valid date format

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sudhir Garg