跳到主要内容

审计事件 (auditevents)

DeepSeek V3 中英对照 Audit Events (auditevents)

auditevents 端点提供了有关应用程序审计事件的信息。

检索审计事件

要检索审计事件,请向 /actuator/auditevents 发起 GET 请求,如下面的基于 curl 的示例所示:

$ curl 'http://localhost:8080/actuator/auditevents?principal=alice&after=2025-01-23T11%3A06%3A31.16794521Z&type=logout' -i -X GET
bash

前面的示例检索了主体 alice 在 2017 年 11 月 7 日 UTC 时区 09:37 之后发生的 logout 事件。生成的响应类似于以下内容:

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

{
"events" : [ {
"timestamp" : "2025-01-23T11:06:31.173361973Z",
"principal" : "alice",
"type" : "logout"
} ]
}
http

查询参数

该端点使用查询参数来限制返回的事件。下表展示了支持的查询参数:

参数描述
after限制事件为在给定时间之后发生的事件。可选。
principal限制事件为具有给定主体的事件。可选。
type限制事件为具有给定类型的事件。可选。

响应结构

响应包含了与查询匹配的所有审计事件的详细信息。下表描述了响应的结构:

路径类型描述
eventsArray审计事件的数组。
events.[].timestampString事件发生的时间戳。
events.[].principalString触发事件的主体。
events.[].typeString事件的类型。