Create an Audit Step

Hello everyone, I need to create a step to intercept the request (with the body, params, headers, verb) and then be able to store it. I already have a endpoint to store it in database. Is there any way to do this using for example a ServiceCallout?

0 1 94
1 REPLY 1

Yes, sure.

If you have an HTTP -accessible endpoint for your audit database, you can do that.

People use Google cloud logging for this purpose, or Splunk, or some other logging system.

Create the payload to send to that logging endpoit as you wish... You can do that with the "message template" capability in Apigee, referencing various context variables that hold information pertaining to the request: request.content for the "body" request.headers.* specifying the headers, request.verb specifying the verb.... you can use system.timestamp for the time, and so on.

See variables reference.

And for example, Log to Splunk.