審計事件 (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.