Audit Log Management API

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

The following operations are supported on this resource:

GET /api/space/audit-log-management/audit-logs (v1)


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

Note:

  • 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 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 informaton about filtering, see the Junos Space SDK Application Developer Guide.

Access Control

The following capabilities are required to access this API:
"ReadAuditLogs"


Example Usage

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

Content Types

  • Produces content types:
    application/vnd.net.juniper.space.audit-log-management.audit-logs+xml;version=1
    application/vnd.net.juniper.space.audit-log-management.audit-logs+json;version=1


  • Sample Output XML:
    <audit-logs total="10" 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 discovery scheduled 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":
    {
      "@total":"10",
      "@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 discovery scheduled with job id 360448",
      "logTime":"2011-08-29 11:01:25 IST",
      "applicationName":"REST",
      "taskName":"POST: /api/space/device-management/discover-devices",
      "result":200
    }
    ]
    }
    }