/api/space/audit-log-management/audit-logs

The following operation is supported on this resource:

  • GET - Get all audit logs in Junos Space
GET /audit-logs Version 1

This API retrieves all audit log entries stored in the database. It returns record entries along with a link to an individual entry. It supports filtering, sorting, and paging.

Filtering and sorting is supported on the following fields:

  • userName
  • userIpAddr
  • description
  • logTime
  • applicationName
  • taskName
  • result

Notes:

  • The 'logTime' field is a timestamp field. By default, 'logTime' is returned for the UTC time zone, but clients can get 'logTime' in their time zone by sending an x-date header in the HTTP request.

  • The 'logTime' field supports . For example:
    /api/space/audit-log-management/audit-logs?filter=(logTime eq timestamp('2011-08-29 11:01:25'))
    /api/space/audit-log-management/audit-logs?filter=(logTime gt timestamp('2011-08-29 11:01:25'))



  • For more information about timestamp filtering, see the Junos Space SDK Application Developer Guide.
.

Sample Usage

GET /audit-logs


  • Sample Output XML:
    <audit-logs uri="/api/space/audit-log-management/audit-logs" size="2">
      <audit-log key="262840" href="/api/space/audit-log-management/audit-logs/262840"
                   uri="/api/space/audit-log-management/audit-logs/262840">
        <userName>super</userName>
        <userIpAddr>172.16.100.2</userIpAddr>
        <description>Login Succeeded</description>
        <logTime>2011-08-29 10:16:18 IST</logTime>
        <applicationName>REST</applicationName>
        <taskName>Login</taskName>
        <result>Success</result>
      </audit-log>
      <audit-log key="262833" href="/api/space/audit-log-management/audit-logs/262833"
                 uri= "/api/space/audit-log-management/audit-logs/262833">
        <userName>super</userName>
        <userIpAddr>172.16.100.2</userIpAddr>
        <description>Job: Device discover shcheduled with job id 196608</description>
        <logTime>2011-08-29 10:12:27 IST</logTime>
        <applicationName>REST</applicationName>
        <taskName>POST: /api/space/device-management/discover-devices</taskName>
        <result>202</result>
      </audit-log>
    </audit-logs>

  • Sample Output JSON:

    {
      "audit-logs": {
          "@uri": "/api/space/audit-log-management/audit-logs",
          "@size":"2",
          "audit-log":[
              {
                  "@href":"/api/space/audit-log-management/audit-logs/589830",
                  "@uri":"/api/space/audit-log-management/audit-logs/589830",
                  "@key":"589830",
                  "userName":"super",
                  "userIpAddr":"172.16.100.2",
                  "description":"Login Succeeded",
                  "logTime":"2011-08-29 11:09:18 IST",
                  "applicationName":"REST",
                  "taskName":"Login",
                  "result":"Success"
              },
              {
                  "@href":"/api/space/audit-log-management/audit-logs/589827",
                  "@uri":"/api/space/audit-log-management/audit-logs/589827",
                  "@key":"589827",
                  "userName":"super",
                  "userIpAddr":"172.16.100.2",
                  "description":"Job: Device discover shcheduled with job id 360448",
                  "logTime":"2011-08-29 11:01:25 IST",
                  "applicationName":"REST",
                  "taskName":"POST: /api/space/device-management/discover-devices",
                  "result":200
              }
          ]
      }

  • Access Control

    The following capabilities are required to access this API: ReadAuditLogs