我正在使用 AWS Kinesis Firehose 流来摄取数据,然后使用 lambda 函数在写入 S3 存储桶之前进行架构验证和数据转换。我之前一直将不正确记录的状态设置为 ProcessingFailed 并将这些错误写入{stream_id}/errors/{timestamp}/processing-failed
文件夹,但该方法会写入自动生成的错误响应:
{
"attemptsMade": "1",
"arrivalTimestamp": "timestamp",
"errorCode": "Lambda.ProcessingFailedStatus",
"errorMessage": "ProcessingFailed status set for record",
"attemptEndingTimestamp": "timestamp",
"rawData": "data example",
"lambdaArn": "arn"
}
是否可以创建一个自定义错误输出类型,该类型将写入{stream_id}/errors/{timestamp}/custom-error
,带有自定义错误消息和看起来更像这样的字段?
{
"errorCode": "ValidationFailedStatus",
"errorMessage": "Validation failed because 'state' was not present in data"
}
我想另一种选择是使用动态分区。