Audit Log REST API
The Audit Log REST API can retrieve data from the audit logs for your Lifecycle instance for the specified time period. The response will contain lines of text from the audit logs in chronologically ascending order.
Permissions Required: Access Audit Log
To configure a custom role that allows users to access the audit logs, click on Create Role button in the Roles section under System Preferences. Ensure that the Access audit log option under the Permissions section is enabled. For more information refer to Roles and Permissions.
Methods Supported
GET
GET /api/v2/auditLogs?startUtcDate={startUtcDate}&endUtcDate={endUtcDate}
Input Parameters
Parameter | Required | Description |
---|---|---|
startUtcDate | Yes | The start date in UTC format (yyyy-mm-dd). Events from this date onwards (inclusive) will be returned in the response. |
endUtcDate | Yes | The end date in UTC format (yyyy-mm-dd). Events up to this date (inclusive) will be returned in the response. |
Example
curl -u admin:admin123 'http://localhost:8070/api/v2/auditLogs?startUtcDate=2024-03-20&endUtcDate=2024-03-21'
where 2024-03-20 is the startUtcDate and 2024-03-21 is the endUtcDate.
The REST API will use the same time zone as that set for the Lifecycle instance, i.e. UTC.
Response
A successful GET request will generate a response consisting of lines from audit logs in chronologically ascending order.
{"timestamp":"2024-03-21T10:39:44.896-03:00","username":"*SYSTEM","domain":"server","type":"start","data":{"serverInstanceId":"7449fbe6-0fb1-4b71-b358-400cc9df673d","serverConfigurationFile":"/home/config.yml","serverRelease":"175.0-SNAPSHOT","serverBuild":"build-number","processOwner":"johndoe"}} {"timestamp":"2024-03-21T11:58:14.233-03:00","remoteIpAddress":"127.0.0.1","userAgent":"curl/7.81.0","username":"admin","domain":"audit-log","type":"export","error":"bad-request"}