Hello,
How to send logs to AWS (CloudWatch) from Proxy's Postclientflow ?
CloudWatch cannot take syslog as input, it has REST API or SDK to push logs but how to use it with MessageLogging policy ?
Thanks.
Solved! Go to Solution.
If CloudWatch has a REST API, then you can use ServiceCallout in PostClientFlow to send the message to the endpoint. The endpoint needs to be publicly accessible, publicly routable.
I think Apigee documentation states that the only policy permitted for use within PostClientFlow is the MessageLogging policy. BUT, Apigee operations can also configure your organization to allow ServiceCallout in PostClient Flow. To make this change, contact your Apigee support rep. There's no charge for that.
So if you can figure out how to make a POST call to your CloudWatch endpoint, with the appropriate credentials and payload, then ... you should be able to use ServiceCallout to emit that call for every request that Apigee handles.
If CloudWatch has a REST API, then you can use ServiceCallout in PostClientFlow to send the message to the endpoint. The endpoint needs to be publicly accessible, publicly routable.
I think Apigee documentation states that the only policy permitted for use within PostClientFlow is the MessageLogging policy. BUT, Apigee operations can also configure your organization to allow ServiceCallout in PostClient Flow. To make this change, contact your Apigee support rep. There's no charge for that.
So if you can figure out how to make a POST call to your CloudWatch endpoint, with the appropriate credentials and payload, then ... you should be able to use ServiceCallout to emit that call for every request that Apigee handles.
Hi, like Dino mentioned, I would recommend using AWS Rest API. I was able to get it working using this Java Callout policy implemented by @miguelmendoza, since you need to add AWS Signature V4 headers to the HTTP requests. Check out his post: https://community.apigee.com/articles/76109/calling-amazon-web-services-aws-rest-apis-from-api.html
Notice that there are some limitations when you are trying to log from multiple proxies, you need to make sure there are no collisions.
From AWS API Documentation here are some limitations:
Hope this helps!
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |