WAF3.0 API¶
POST 查询规则触发占比¶
POST /prod-api/waf/wafv3/statistic/describeRulesProportion
统计指定时间范围内 WAF 日志中 按规则类型划分的触发次数,用于饼图/柱状图展示三类规则占比:
| 返回字段 | 含义 |
|---|---|
customRule |
自定义规则 触发次数 |
customLimitRule |
自定义限速规则 触发次数 |
custodyRule |
托管规则(含 OWASP CRS 等,非上述两类标签时归入)触发次数 |
服务端根据日志字段 transaction.messages.details.tags 分类聚合;无需在 action 中传指标名。
Body 请求参数
{
"action": [],
"otherFilter": [],
"params": {
"beginTime": "2026-05-20 16:49:02",
"endTime": "2026-05-20 17:49:02"
}
}
限定套餐(控制台常用):
{
"action": [],
"otherFilter": [
{
"oneVal": "oid",
"twoVal": "eq",
"threeVal": ["20240412279097884616"]
}
],
"params": {
"beginTime": "2026-05-20 16:49:02",
"endTime": "2026-05-20 17:49:02"
}
}
Body 字段说明¶
| 字段 | 类型 | 必选 | 说明 |
|---|---|---|---|
action |
array | 是 | 固定传 [],本接口不使用该字段 |
otherFilter |
array | 否 | 日志筛选,规则同 查询高级监控数据(oneVal 仅支持 eq / ne) |
params |
object | 是 | 时间范围:beginTime、endTime(yyyy-MM-dd HH:mm:ss) |
时间范围限制¶
- 缺少
params.beginTime/endTime时返回「请选择时间范围」。
请求参数¶
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| Authorization | header | string | 是 | 鉴权 | Bearer Token |
| body | body | object | 是 | 请求体 | 见上文 |
返回示例
200 Response
无触发记录时(默认均为 0):
有数据时:
{
"msg": "成功",
"code": 200,
"data": {
"customRule": 1280,
"customLimitRule": 320,
"custodyRule": 5600
}
}
返回结果¶
| 状态码 | 状态码含义 | 说明 |
|---|---|---|
| 200 | OK | 成功 |
| 401 | Unauthorized | 未授权 |
| 403 | Forbidden | 无权限 |
返回数据结构¶
状态码 200
| 名称 | 类型 | 说明 |
|---|---|---|
code |
integer | 200 表示成功 |
msg |
string | 提示信息 |
data |
object | 三类规则触发次数(非数组) |
data 字段¶
| 字段 | 类型 | 说明 |
|---|---|---|
customRule |
integer | 自定义规则 |
customLimitRule |
integer | 限速规则 |
custodyRule |
integer | 基础防护规则数 |
使用说明¶
与 查询攻击数据、查询高级监控数据 共用 otherFilter、params 约定;本接口返回 对象 而非趋势数组或 Top 列表。