审计事件 (auditevents)

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

检索审计事件

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

$ curl 'https://:8080/actuator/auditevents?principal=alice&after=2017-11-07T09%3A37Z&type=logout' -i -X GET

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

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

{
  "events" : [ {
    "principal" : "alice",
    "timestamp" : "2017-11-07T09:38:13Z",
    "type" : "logout"
  } ]
}

查询参数

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

参数 描述

after

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

principal

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

类型

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

响应结构

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

路径 类型 描述

events

数组

一个审计事件数组。

events.[].timestamp

字符串

事件发生的时间戳。

events.[].principal

字符串

触发事件的主体。

events.[].type

字符串

事件的类型。

© . This site is unofficial and not affiliated with VMware.