I am trying to push my API Gateway logs into Elasticsearch. I have this working with the exception of one annoying flaw. I can't seem to get the original resource path as I am using a proxy lambda function. I set my API logging format up as follows;
{
"requestId": "$context.requestId",
"ip": "$context.identity.sourceIp",
"caller": "$context.identity.caller",
"user": "$context.identity.user",
"requestTime": "$context.requestTime",
"httpMethod": "$context.httpMethod",
"resourcePath": "$context.resourcePath",
"status": "$context.status",
"protocol": "$context.protocol",
"responseLength": "$context.responseLength"
}
Which give me the following out;
{
"requestId": "xxxxxxxxxxxxxx",
"ip": "xxx.xxx.xxx.xxx",
"caller": "-",
"user": "-",
"requestTime": "16/Apr/2019:11:03:49 +0000",
"httpMethod": "GET",
"resourcePath": "/{proxy+}",
"status": "304",
"protocol": "HTTP/1.1",
"responseLength": "0"
}
How do I get the actual resource path instead of /{proxy+}
? The documentation doesn't seem to make it clear;