Apigee cloud , how to retrieve audit logs for the org using api proxy

@Anil Sagar @ Google

How to download audit logs from Apigee cloud . Can severity like error/ warn / debug be declared ?

Possibility of getting audit logs from the policies in api proxy. Any example code will be helpful.

Solved Solved
0 7 1,955
2 ACCEPTED SOLUTIONS

There is a thing Apigee Edge calls "Audit logs" which records... administrative changes in Apigee Edge. If an administrator create a proxy, create a product, modify a developer entity (via the Admin UI or API) , etc... those are actions that are recorded in the Audit log. You can view the audit log in the Admin UI, or you can read it via the audits API. https://apidocs.apigee.com/api/audits-0

Actions taken by API Proxies are not stored in an Audit log.

If you would like to record information from requests handled by smart proxies in Apigee Edge, you have a couple options

  1. The analytics database. There is an analytics record stored for every message handled by Apigee Edge. Use the Statistics Collector to add your own data into that record. https://docs.apigee.com/api-platform/reference/policies/statistics-collector-policy Then you can create a custom report to see the analytics on that data.
  2. an external logging system, like Stackdriver, or loggly, or something else. In that case, just log to that system from within the proxy. In these you can specify ERROR, WARNING, INFO and so on.

We don't call either of these things "audit logs". Transaction log, maybe.

View solution in original post

Hi @Manohar BJ, as mentioned by Dino Audit Logs and Analytics are two different things.

If you are specifically looking for audit logs than as mentioned in above post, use the Audit Logs REST APIs. There no need to create a new proxy again.

The URL contains 10+ Audit Logs Management APIs,

https://apidocs.apigee.com/api/audits-0

https://apidocs.apigee.com/management/apis/get/audits/organizations/%7Borg_name%7D/developers

View solution in original post

7 REPLIES 7

There is a thing Apigee Edge calls "Audit logs" which records... administrative changes in Apigee Edge. If an administrator create a proxy, create a product, modify a developer entity (via the Admin UI or API) , etc... those are actions that are recorded in the Audit log. You can view the audit log in the Admin UI, or you can read it via the audits API. https://apidocs.apigee.com/api/audits-0

Actions taken by API Proxies are not stored in an Audit log.

If you would like to record information from requests handled by smart proxies in Apigee Edge, you have a couple options

  1. The analytics database. There is an analytics record stored for every message handled by Apigee Edge. Use the Statistics Collector to add your own data into that record. https://docs.apigee.com/api-platform/reference/policies/statistics-collector-policy Then you can create a custom report to see the analytics on that data.
  2. an external logging system, like Stackdriver, or loggly, or something else. In that case, just log to that system from within the proxy. In these you can specify ERROR, WARNING, INFO and so on.

We don't call either of these things "audit logs". Transaction log, maybe.

Hi Dino,

Can we read those audit logs by creating a new api proxy or by defining a JS library ?

The requirement for us to do the file transfer to the support pdl.

Regards,

Manohar

I don't think you want to read audit logs from an API Proxy. That would be an anti-pattern.

I don't know what you mean by "defining a JS library", but .. you can read audit logs using apigee-edge-js.

Here's an example script that ues that library and shows how to find the last editor of a proxy. The script matches the audit records against regular expressions. If you want to find some other sort of audit record, you would match the audit log on a different regex.

Hi @Manohar BJ, as mentioned by Dino Audit Logs and Analytics are two different things.

If you are specifically looking for audit logs than as mentioned in above post, use the Audit Logs REST APIs. There no need to create a new proxy again.

The URL contains 10+ Audit Logs Management APIs,

https://apidocs.apigee.com/api/audits-0

https://apidocs.apigee.com/management/apis/get/audits/organizations/%7Borg_name%7D/developers

Thanks Siddharth!

Hey guys.. Does apigee or any apigee customer has any open source tooling developed to pull the audit logs using Audit APIs?

Any pointer towards an answer is much appreciated.

Please ask new questions as new questions, not as answers to existing questions.

8370-ask-a-question.png