Get Audit Log Information
/console/admin/api/v2/dashboard/statistics/auditlog
Request
- application/json
-
action: string
The name of the audit log action to return
-
endTime(required): string
The end time of a time range in the format 'yyyyMMddhhmmss'
-
limit: number
The maximum number of log entries to return. If not specified, defaults to 100, which is also the maximum allowed value of the parameter.
-
offset: number
The number of log entries to skip
-
startTime(required): string
The start time of a time range in the format 'yyyyMMddhhmmss'
-
userIdentity: string
The user identity
Response
- application/json
200 Response
object
400 Response
Default Response
Examples
This endpoint is used to get the instance audit log, which records administrative console activity including actions related to channels, organizations, nodes, and chaincode. The action, userIdentity, limit, and offset parameters affect the behavior of the endpoint. The result is a JSON body that contains a series of audit log entries for the specified scope in the specified time range.
The following example shows how to retrieve the audit log by submitting a GET request on the REST resource using cURL.
curl -X GET -u username:password -k "http://<rest_server_url>:port/console/admin/api/v2/dashboard/statistics/auditlog?startTime=<yyyymmddhhmmss>&endTime=<yyyymmddhhmmss>"
For example,
curl -X GET -u username:password -k "http://<rest_server_url>:port/console/admin/api/v2/dashboard/statistics/auditlog?limit=50&offset=10&startTime=20210811050000&endTime=20210812050000"
Example of the Response Body
The following example shows the contents of the response body in JSON format:
{ "limit": 50, "offset": 10, "count": 2, "auditLog": [ { "TimeStamp": "2021-08-12 00:05:22.553", "UserIdentity": "jsmith@example.com", "Component": "CONSOLE", "ComponentID": "console-1", "Severity":"Informative", "Action": "Start Peer", "ActionStatus": "Succeeded", "Details": "Start Peer(peer1) successfully" }, { "TimeStamp": "2021-08-12 00:05:25.553", "UserIdentity": "jsmith@example.com", "Component": "CONSOLE", "ComponentID": "console-1", "Severity":"Informative", "Action": "Start Peer", "ActionStatus": "Succeeded", "Details": "Start Peer(peer2) successfully" } ] }