Hi @dchiesa1 , yes that worked. I guess its better name my own variables with names that don’t collide with internal apigee vars (e.g. instead of target.request.content use totarget.request.content). Thanks for that.
I now face a different issue related with cloud logging API. The SC on the PostClientFlow is meant to call the GCloud logging API
<ServiceCallout name="SC.CloudLogging">
<Request>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<Set>
<Payload contentType="application/json">{
"logName": "projects/{organization.name}/logs/apigee-runtime",
"resource" : {
"type": "api",
"labels": {}
},
"labels": {
"application": "apigee",
"proxy":"logging-example"
},
"entries": [{
"severity": "INFO",
"jsonPayload": {
"organization": "{organization.name}",
"environment": "{environment.name}",
"apiProxy": "{apiproxy.name}",
"apiProxyRevision": "{apiproxy.revision}",
"apiProduct": "{apiproduct.name}",
"developerApp": "{apiproduct.name}",
"clientId": "{client_id}",
"developerId": "{developer.id}",
"requestUri": "{request.uri}",
"requestUrl": "{request.url}",
"verb": "{request.verb}",
"correlationId": "{messageid}",
"proxyRequestReceived": "{client.received.end.timestamp}",
"proxyResponseSent": "{client.sent.end.timestamp}",
"targetResponseReceived": "{target.received.end.timestamp}",
"targetRequestSent": "{target.sent.end.timestamp}",
"targetResponseCode": "{message.status.code}",
"proxyResponseCode": "{response.status.code}",
"clientReceived": "{client.received.start.timestamp}",
"clientSent": "{client.sent.start.timestamp}",
"targetUrl":"{target.url}",
"target.request.body":"{totarget.request.content}"
"target.request.querystring":"{totarget.request.querystring}",
<!--"target.response.body":"{fromtarget.response.content}",-->
"target.response.status.code":"{fromtarget.response.status.code}",
<!-- "error.content":"{error.content}",-->
"error.message":"{error.message}",
"error.status.code":"{error.status.code}",
"faultName":"{fault.name}"
}
}],
"partialSuccess": true
}
</Payload>
<Verb>POST</Verb>
</Set>
</Request>
<HTTPTargetConnection>
<Authentication>
<GoogleAccessToken>
<Scopes>
<Scope>https://www.googleapis.com/auth/logging.write</Scope>
</Scopes>
<LifetimeInSeconds>3600</LifetimeInSeconds>
</GoogleAccessToken>
</Authentication>
<URL>https://logging.googleapis.com/v2/entries:write</URL>
</HTTPTargetConnection>
</ServiceCallout>
The issue is that every time I try to log the totarget.request.content var to GCloud API, the SC ends with an error. I imagine that’s because I will have JSON inside JSON… If I disable that line the SC ends successfully. Any ideas of how to get this log working?
Thanks!