You are browsing documentation for an outdated version. See the latest documentation here.

Audit Logs

You can access request and database audit logs through the Admin API.

For usage examples, see Audit Logging in Kong Gateway.

List audit logs

List request audit logs

Endpoint

/audit/requests

Response

  1. HTTP 200 OK

Example response generated for checking the /status endpoint without RBAC enabled:

  1. {
  2. "data": [
  3. {
  4. "client_ip": "127.0.0.1",
  5. "method": "GET",
  6. "path": "/status",
  7. "payload": null,
  8. "rbac_user_id": null,
  9. "removed_from_payload": null,
  10. "request_id": "OjOcUBvt6q6XJlX3dd6BSpy1uUkTyctC",
  11. "request_timestamp": 1676424547,
  12. "signature": null,
  13. "status": 200,
  14. "ttl": 2591997,
  15. "workspace": "1065b6d6-219f-4002-b3e9-334fc3eff46c"
  16. }
  17. ],
  18. "total": 1
  19. }

List database audit logs

Endpoint

/audit/objects

Response

  1. HTTP 200 OK

Example response for a consumer creation log entry:

  1. {
  2. "data": [
  3. {
  4. "dao_name": "consumers",
  5. "entity": "{\"created_at\":1542131418000,\"id\":\"16787ed7-d805-434a-9cec-5e5a3e5c9e4f\",\"username\":\"bob\",\"type\":0}",
  6. "entity_key": "16787ed7-d805-434a-9cec-5e5a3e5c9e4f",
  7. "expire": 1544723418009,
  8. "id": "7ebabee7-2b09-445d-bc1f-2092c4ddc4be",
  9. "operation": "create",
  10. "request_id": "59fpTWlpUtHJ0qnAWBzQRHRDv7i5DwK2"
  11. },
  12. ],
  13. "total": 1
  14. }