审计事件 (auditevents)
审计事件端点提供了有关应用程序审计事件的信息。
检索审计事件
要检索审计事件,请向 /actuator/auditevents
发送 GET
请求,如下所示的基于 curl 的示例:
curl 'http://localhost:8080/actuator/auditevents?principal=alice&after=2024-08-22T16%3A49%3A59.642365836Z&type=logout' -i -X GET
上述示例检索了在 2017 年 11 月 7 日 UTC 时区 09:37 之后发生的,针对主体 alice
的 logout
事件。 得到的响应类似于以下内容:
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 127
{
"events" : [ {
"timestamp" : "2024-08-22T16:49:59.648097254Z",
"principal" : "alice",
"type" : "logout"
} ]
}