此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Boot 3.3.1

此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Boot 3.3.1

终结点提供有关应用程序审核事件的信息。auditevents

检索审核事件

若要检索审核事件,请向 发出请求,如以下基于 curl 的示例所示:GET/actuator/auditevents

$ curl 'http://localhost:8080/actuator/auditevents?principal=alice&after=2024-06-20T18%3A36%3A17.302802727Z&type=logout' -i -X GET

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

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

{
  "events" : [ {
    "timestamp" : "2024-06-20T18:36:17.303347547Z",
    "principal" : "alice",
    "type" : "logout"
  } ]
}

查询参数

终结点使用查询参数来限制它返回的事件。 下表显示了支持的查询参数:

参数 描述

after

将事件限制为在给定时间之后发生的事件。自选。

principal

将事件限制为具有给定主体的事件。自选。

type

将事件限制为具有给定类型的事件。自选。

响应结构

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

路径 类型 描述

events

Array

一系列审核事件。

events.[].timestamp

String

事件发生时间的时间戳。

events.[].principal

String

触发事件的主体。

events.[].type

String

事件的类型。

参数 描述

after

将事件限制为在给定时间之后发生的事件。自选。

principal

将事件限制为具有给定主体的事件。自选。

type

将事件限制为具有给定类型的事件。自选。

路径 类型 描述

events

Array

一系列审核事件。

events.[].timestamp

String

事件发生时间的时间戳。

events.[].principal

String

触发事件的主体。

events.[].type

String

事件的类型。