nla日志¶
POST 查询日志¶
POST /prod-api/waf/nlaV1/log/describeLog
在指定 时间范围 内分页查询 WAF / NLA 访问与安全日志 明细。请求体通过 action 声明指标(本接口为 logs 日志列表)、pageNo / pageSize 分页;params 传入起止时间;otherFilter 为 对象数组,每一项是一条筛选条件(oneVal / twoVal / threeVal),无筛选时传 []。
说明:本接口 metricName 固定为 logs(日志记录列表)。攻击趋势时序接口使用 logTread(见「查询攻击数据」文档),二者不同。
Body 请求参数
{
"action": [
{
"metricName": "logs",
"pageNo": 1,
"pageSize": 15
}
],
"otherFilter": [],
"params": {
"beginTime": "2026-05-12 17:37:33",
"endTime": "2026-05-15 17:37:33"
}
}
请求参数¶
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| Authorization | header | string | 是 | - | |
| body | body | DescribeWafV3StatisticVO | 是 | 查询体 | 见下文「Body 请求参数字段说明」。 |
| » action | body | [object] | 否 | - | |
| »» metricName | body | string | 否 | metricName | 本接口取值为 logs;见「metricName 取值一览」。 |
| »» pageNo | body | integer(int32) | 否 | 日志列表分页页码,从 1 开始。 |
|
| »» pageSize | body | integer(int32) | 否 | 每页条数。 | |
| » otherFilter | body | [StatisticOtherFilterVO] | 否 | 筛选条件 | - |
| »» StatisticOtherFilterVO | body | StatisticOtherFilterVO | 否 | StatisticOtherFilterVO | - |
| »»» oneVal | body | string | 否 | 搜索名称 | 见下文「oneVal 常用取值(筛选维度)」。 |
| »»» threeVal | body | [string] | 否 | - | |
| »»» twoVal | body | string | 否 | 等于或者不等于 | eq 等于;ne 不等于;见「otherFilter[]」。 |
| » params | body | object | 否 | 含 beginTime、endTime;见下文「params(时间范围)」。 |
Body 请求参数字段说明
| 字段名称 | 类型 | 说明 |
|---|---|---|
action |
数组 | 要查询的 指标与分页 配置列表;本接口通常仅一项(见下表「action[]」)。 |
otherFilter |
数组 | 附加筛选条件列表;每一项 为一条筛选条件(见下表「otherFilter[]」)。无筛选时传 []。 |
params |
对象 | 公共查询参数,至少需要统计时间范围(见下表)。 |
action[](每一项)
| 字段名称 | 类型 | 说明 |
|---|---|---|
metricName |
string | 本接口取值为 logs(日志明细列表);须与下文「metricName 取值一览」一致(区分大小写)。 |
pageNo |
number | 当前页码,从 1 开始。 |
pageSize |
number | 每页返回的日志条数。 |
metricName 取值一览¶
metricName |
含义说明 |
|---|---|
logs |
访问与安全日志 明细列表;返回中 list[] 为单条日志记录,字段见下文「返回示例字段说明」。 |
(若后续扩展其它 metricName,以实现与控制台为准。)
otherFilter[](每一项)
otherFilter 为 对象数组:每个元素表示一条筛选条件;多条条件如何组合(与/或)以实现为准。单条元素示例(按套餐 oid 等于 22 过滤):
| 字段名称 | 类型 | 说明 |
|---|---|---|
oneVal |
string | 筛选 维度(字段名);常用取值见下文「oneVal 常用取值(筛选维度)」。 |
twoVal |
string | 比较方式:eq 表示等于;ne 表示不等于。 |
threeVal |
string[] | 比较值 列表,与 oneVal、twoVal 搭配使用;多值语义以实现为准。 |
带 otherFilter 的完整 Body 示例:
{
"action": [
{
"metricName": "logs",
"pageNo": 1,
"pageSize": 15
}
],
"otherFilter": [
{
"oneVal": "oid",
"twoVal": "eq",
"threeVal": ["22"]
}
],
"params": {
"beginTime": "2026-05-12 17:37:33",
"endTime": "2026-05-15 17:37:33"
}
}
params(时间范围)
| 字段名称 | 类型 | 说明 |
|---|---|---|
beginTime |
string | 统计开始时间,格式与示例一致(YYYY-MM-DD HH:mm:ss)。 |
endTime |
string | 统计结束时间,需不早于 beginTime。 |
oneVal 常用取值(筛选维度)¶
oneVal |
含义 |
|---|---|
oid |
套餐 |
client_ip |
来源 IP |
domain |
域名 |
url |
URL |
status |
状态码 |
request_method |
请求方法 |
server_port |
端口 |
ua_os_name |
操作系统 |
ua_name |
浏览器 |
rule_tags |
规则标签 |
client_country_name |
国家/地区 |
client_city_name |
城市 |
waf_acl_id |
策略组 |
rule_Id |
规则 ID |
action |
处置动作 |
(其它用于 otherFilter.oneVal 的筛选维度以实现与控制台为准。)
返回示例
200 Response
{
"msg": "成功",
"code": 200,
"data": [
{
"metricName": "logs",
"list": [
{
"requestId": "9a8dd5baa3e3e80ef69a1ea7c03265a8",
"aclId": "74",
"clientIp": "20.197.195.237",
"ua": null,
"geoip": {
"country": "United States",
"regionName": null,
"latitude": 37.751,
"longitude": -97.822,
"countryCode": "US"
},
"rules": [
{
"ruleId": "122",
"ruleMessage": "人机",
"matches": [
{
"parameter": "/insta.php",
"operator": "BEGINS_WITH",
"target": "REQUEST_URI"
}
]
}
],
"scheme": "http",
"requestMethod": "GET",
"httpUserAgent": "",
"protocol": "HTTP/1.1",
"url": "/insta.php",
"domain": "lwtest.ruisuyun.com",
"serverPort": "80",
"referer": "",
"action": "captcha",
"status": 200,
"timestamp": "2026-05-14 14:21:33"
},
{
"requestId": "f26774c45dd96f0c7eb923cb77f50649",
"aclId": "74",
"clientIp": "20.197.195.237",
"ua": null,
"geoip": {
"country": "United States",
"regionName": null,
"latitude": 37.751,
"longitude": -97.822,
"countryCode": "US"
},
"rules": [
{
"ruleId": "122",
"ruleMessage": "人机",
"matches": [
{
"parameter": "/99.php",
"operator": "BEGINS_WITH",
"target": "REQUEST_URI"
}
]
}
],
"scheme": "http",
"requestMethod": "GET",
"httpUserAgent": "",
"protocol": "HTTP/1.1",
"url": "/99.php",
"domain": "lwtest.ruisuyun.com",
"serverPort": "80",
"referer": "",
"action": "captcha",
"status": 200,
"timestamp": "2026-05-14 14:21:32"
}
]
}
]
}
返回示例字段说明¶
根级¶
| 字段名称 | 说明 |
|---|---|
msg |
提示信息,成功时多为「成功」等。 |
code |
业务状态码,成功时为 200。 |
data |
数组:与请求中 action[] 顺序对应;本接口通常仅含 metricName 为 logs 的一项。 |
data[](每一项)¶
| 字段名称 | 说明 |
|---|---|
metricName |
固定为 logs,表示本块为日志列表数据。 |
list |
日志记录数组,元素为单条访问/安全事件日志(见下表)。 |
list[](单条日志)¶
| 字段名称 | 类型 | 说明 |
|---|---|---|
requestId |
string | 单次请求的唯一标识,用于排查与关联。 |
aclId |
string | 命中的 策略组(ACL) ID。 |
clientIp |
string | 客户端来源 IP。 |
ua |
object / null | 解析后的 UA 结构;无解析结果时可能为 null(与 httpUserAgent 原文可同时参考)。 |
geoip |
object | 地理位置 解析结果,字段见下表「geoip」。 |
rules |
array | 命中的 规则列表;每条含规则 ID、文案及匹配细节,结构见下表「rules[]」。 |
scheme |
string | 请求协议层,如 http、https。 |
requestMethod |
string | HTTP 方法,如 GET、POST。 |
httpUserAgent |
string | 原始 User-Agent 头内容;可能为空字符串。 |
protocol |
string | 应用层协议版本文案,如 HTTP/1.1。 |
url |
string | 请求路径(含查询串与否以实现为准),示例为路径部分。 |
domain |
string | 访问的 Host / 域名。 |
serverPort |
string | 站点监听端口(字符串形式,如 80、443)。 |
referer |
string | Referer 请求头;无则可能为空字符串。 |
action |
string | 处置结果 / 动作,如 captcha(人机验证)等;具体枚举以实现与控制台为准。 |
status |
number | HTTP 响应状态码(日志记录中的应答码)。 |
timestamp |
string | 事件发生时间,格式与示例一致(YYYY-MM-DD HH:mm:ss)。 |
geoip(对象)¶
| 字段名称 | 说明 |
|---|---|
country |
国家或地区名称(英文或其它地理库文案)。 |
regionName |
省州等区域名;无则可能为 null。 |
latitude |
纬度,数值类型。 |
longitude |
经度,数值类型。 |
countryCode |
ISO 国家/地区二位码,如 US。 |
rules[](命中规则)¶
| 字段名称 | 说明 |
|---|---|
ruleId |
规则 ID。 |
ruleMessage |
规则名称或说明(控制台展示文案)。 |
matches |
该规则下 匹配条件 列表,元素结构见下表「matches[]」。 |
matches[](规则匹配项)¶
| 字段名称 | 说明 |
|---|---|
parameter |
参与匹配的具体值或模式片段(如 URI 路径)。 |
operator |
匹配算子,如 BEGINS_WITH(前缀匹配)等;完整枚举以实现为准。 |
target |
匹配作用目标,如 REQUEST_URI 表示针对请求 URI。 |
返回结果¶
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | OK | 内联 |
| 201 | Created | Created | 无独立数据模型 |
| 401 | Unauthorized | Unauthorized | 无独立数据模型 |
| 403 | Forbidden | Forbidden | 无独立数据模型 |
| 404 | Not Found | Not Found | 无独立数据模型 |
返回数据结构(速查)¶
状态码 200
| 名称 | 类型 | 必选 | 说明 |
|---|---|---|---|
msg |
string | 是 | 提示信息。 |
code |
integer | 是 | 业务状态码。 |
data |
[object] | 是 | 与 action[] 对应的结果块。 |
data[].metricName |
string | 否 | 本接口为 logs。 |
data[].list |
[object] | 否 | 日志记录列表;字段含义见「返回示例字段说明」。 |
数据模型¶
Action
Action
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| metricName | string | 否 | - | 指标名 | 本接口为 logs;见上文「metricName 取值一览」。 |
| pageNo | integer(int32) | 否 | - | 当前页数 | 从 1 开始。 |
| pageSize | integer(int32) | 否 | - | 每页条数 | 每页日志条数。 |
DescribeWafV3StatisticVO
{
"action": [
{
"metricName": "string",
"pageNo": 0,
"pageSize": 0
}
],
"otherFilter": [
{
"oneVal": "string",
"threeVal": ["string"],
"twoVal": "string"
}
],
"params": {
"beginTime": "string",
"endTime": "string"
}
}
DescribeWafV3StatisticVO
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| action | [Action] | 否 | - | 指标与分页 | 本接口通常为单元素,metricName 为 logs。 |
| otherFilter | [StatisticOtherFilterVO] | 否 | - | 筛选条件 | 见上文「otherFilter[]」。 |
| params | object | 否 | - | 公共参数 | 需包含 beginTime、endTime。 |
| » beginTime | string | 否 | - | 开始时间 | 统计区间起点。 |
| » endTime | string | 否 | - | 结束时间 | 统计区间终点。 |
StatisticOtherFilterVO
StatisticOtherFilterVO
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| oneVal | string | 否 | - | 筛选维度键 | 取值含义见上文「oneVal 常用取值(筛选维度)」。 |
| twoVal | string | 否 | - | 比较方式 | eq:等于;ne:不等于。 |
| threeVal | [string] | 否 | - | 条件值(多值) | 与 oneVal、twoVal 组合使用。 |