审计事件(auditevents
)
auditevents
端点提供有关应用程序审计事件的信息。
获取审计事件
要获取审计事件,请对 /actuator/auditevents
发起 GET
请求,如下所示(基于 curl 的示例):
$ curl 'http://localhost:8080/actuator/auditevents?principal=alice&after=2025-05-26T11%3A07%3A51.153361%2B08%3A00&type=logout' -i -X GET
上述示例检索了主体 alice
在 2017 年 11 月 7 日 09:37(UTC 时区)之后发生的 logout
事件。
返回的响应类似如下:
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 124
{
"events" : [ {
"timestamp" : "2025-05-26T03:07:51.153785Z",
"principal" : "alice",
"type" : "logout"
} ]
}