Audit Events (auditevents)

The auditevents endpoint provides information about the application’s audit events.spring-doc.cn

Retrieving Audit Events

To retrieve the audit events, make a GET request to /actuator/auditevents, as shown in the following curl-based example:spring-doc.cn

$ curl 'http://localhost:8080/actuator/auditevents?principal=alice&after=2024-11-21T16%3A02%3A32.656170834Z&type=logout' -i -X GET

The preceding example retrieves logout events for the principal, alice, that occurred after 09:37 on 7 November 2017 in the UTC timezone. The resulting response is similar to the following:spring-doc.cn

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 127

{
  "events" : [ {
    "timestamp" : "2024-11-21T16:02:32.663901672Z",
    "principal" : "alice",
    "type" : "logout"
  } ]
}

Query Parameters

The endpoint uses query parameters to limit the events that it returns. The following table shows the supported query parameters:spring-doc.cn

Parameter Description

afterspring-doc.cn

Restricts the events to those that occurred after the given time. Optional.spring-doc.cn

principalspring-doc.cn

Restricts the events to those with the given principal. Optional.spring-doc.cn

typespring-doc.cn

Restricts the events to those with the given type. Optional.spring-doc.cn

Response Structure

The response contains details of all of the audit events that matched the query. The following table describes the structure of the response:spring-doc.cn

Path Type Description

eventsspring-doc.cn

Arrayspring-doc.cn

An array of audit events.spring-doc.cn

events.[].timestampspring-doc.cn

Stringspring-doc.cn

The timestamp of when the event occurred.spring-doc.cn

events.[].principalspring-doc.cn

Stringspring-doc.cn

The principal that triggered the event.spring-doc.cn

events.[].typespring-doc.cn

Stringspring-doc.cn

The type of the event.spring-doc.cn