Get Audit Log Information

get

/console/admin/api/v2/dashboard/statistics/auditlog

The audit log records administrative console activity for the instance, including actions related to channels, organizations, nodes, and chaincode.

Request

Supported Media Types
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

Response with a series of audit logs by restriction.
Body ()
Root Schema : schema
Type: object
Show Source
Nested Schema : StatsAuditLog
Type: object
Show Source
Nested Schema : auditLogs
Type: array
Show Source
Nested Schema : items
Type: object

400 Response

Invalid arguments
Body ()
Root Schema : 400errorModels
Type: object
Show Source
Example:
{
    "respMesg":"invalid argument"
}

Default Response

Unexpected error
Body ()
Root Schema : errorModel
Type: object
Show Source
Back to Top

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"
    }
  ]
}
Back to Top