NATSaudit.log.summary审计日志汇总

按时间窗返回计数与动作分布,供管理仪表盘使用。

Request Payload

消息格式:JSON

NameData TypeRequiredDescription
sincestringYes起始时间(ISO 8601 UTC)
untilstringYes结束时间(ISO 8601 UTC)
userIdstringNo限定行为主体(可选)
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:

NameData TypeRequiredDescription
totalEventsnumberYes窗口内事件总数
successCountnumberYes成功事件数
failureCountnumberYes失败事件数
topActionsarrayYes出现频次最高的动作
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 }
    ]
  }
}