NATSaudit.log.summary审计日志汇总
Try it 面板需要启用 JavaScript。
按时间窗返回计数与动作分布,供管理仪表盘使用。
Request Payload
消息格式:JSON
| Name | Data Type | Required | Description |
|---|---|---|---|
| since | string | Yes | 起始时间(ISO 8601 UTC) |
| until | string | Yes | 结束时间(ISO 8601 UTC) |
| userId | string | No | 限定行为主体(可选) |
type RequestBody = {
/** 起始时间(ISO 8601 UTC) */
since: string
/** 结束时间(ISO 8601 UTC) */
until: string
/** 限定行为主体(可选) */
userId?: string
}{
"since": "2026-10-01T00:00:00Z",
"until": "2026-10-14T00:00:00Z"
}Response Payload
回复使用统一信封 {id, code, messages, result},其 result:
| Name | Data Type | Required | Description |
|---|---|---|---|
| totalEvents | number | Yes | 窗口内事件总数 |
| successCount | number | Yes | 成功事件数 |
| failureCount | number | Yes | 失败事件数 |
| topActions | array | Yes | 出现频次最高的动作 |
type ResponseBody = {
/** 窗口内事件总数 */
totalEvents: number
/** 成功事件数 */
successCount: number
/** 失败事件数 */
failureCount: number
/** 出现频次最高的动作 */
topActions: Record<string, unknown>[]
}{
"totalEvents": 8521,
"successCount": 8104,
"failureCount": 417,
"topActions": [
{
"action": "auth.login.password",
"count": 3120
},
{
"action": "auth.login.otp",
"count": 2014
},
{
"action": "org.member.remove",
"count": 402
}
]
}Response Code
回复使用统一信封 {id, code, messages, result},其 code 字段:
| code | Meaning | Notes |
|---|---|---|
| 0 | 成功 | 审计日志汇总 |
Examples
{ "since": "2026-10-01T00:00:00Z", "until": "2026-10-14T00:00:00Z" }
{
"id": "01JD8SXGS7T9VR",
"code": 0,
"messages": [],
"result": {
"totalEvents": 8521,
"successCount": 8104,
"failureCount": 417,
"topActions": [
{ "action": "auth.login.password", "count": 3120 },
{ "action": "auth.login.otp", "count": 2014 },
{ "action": "org.member.remove", "count": 402 }
]
}
}