Andres Mora
08/13/2025, 11:58 AM{
'Type': 'Notification',
'MessageId': 'd4aa09a0-6d51-5219-bcb2-68b12345bd7b',
'TopicArn': 'arn:aws:sns:us-east-1:1234567890:sns_topic',
'Subject': 'Amazon S3 Notification',
'Message': '{
"Records":
[
{
"eventVersion":"2.1",
"eventSource":"aws:s3",
"eventTime":"2025-08-12T16:25:24.066Z",
"s3":{"s3SchemaVersion":"1.0","configurationId":"New file",
"bucket":{"name":"testing.data","arn":"arn:aws:s3:::testing.data"},
"object":{"key":"data_file.csv","size":34}
}
}
]
}',
'Timestamp': '2025-08-12T16:25:24.883Z',
}
I want to capture the object key "_data_file.csv_" but i haven't been able to. What I've tested is:
In the Webhook's template, if I extract, for example, the MessageId
like this: "messageId": "{{ body.MessageId }}"
There is no issue. This works fine.
But if I try to extract something from inside the Message
of the body using something like this: "file_name": "{{ body.Message.Records[0].s3.object.key }}"
Nothing happens, file_name ends up being empty.
I thought that maybe the whole Message
was being parsed as a single string so I did this just to test: "file_name": "{{ body.Message }}"
This made the Webhook fail with this error: "_unexpected character: line 8 column 23 (char 425)_"
It seems like I just cannot access Message
, not even as a string(?)
Does anyone understand this issue and know how to extract the value I'm trying to obtain?
Thanks for the help!Brendan Dalpe
08/13/2025, 5:45 PMmessage
field is a string, so trying to do Records[0].s3.object.key
will fail.Brendan Dalpe
08/13/2025, 6:18 PMBrendan Dalpe
08/13/2025, 6:19 PM