跳转至

列出



GET /api/v1/logging_query_rule/list

概述

分页读取日志访问规则及其来源与启停配置。

调用前和使用步骤

查询当前空间非删除规则,包含禁用项,按createAt倒序。本公开入口仅支持pageIndex/pageSize,不支持内部search或effectiveRulesForCurAcnt;不返回前台才开启的成员计数/成员和角色展开。

规则保存影响后续符合条件身份的数据查询范围/结果脱敏,不修改、删除或补采原始数据,也不新增角色的基础查询权限。多个角色及规则按查询侧策略合并,不能仅凭单条规则推断最终权限;Owner豁免,管理员和空间的“数据访问范围限制”设置会改变无匹配角色的处理,应使用代表成员实际查询验收。本次只读规则,不修改配置或清理规则缓存。

请求头

参数名 类型 必选 说明
DF-API-KEY string Y 工作空间的 OpenAPI 鉴权凭据。
例子: <DF-API-KEY>
获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。

Query 请求参数

参数名 类型 必选 说明
pageSize integer 可选,默认50,无声明最大值;小页减少返回量但当前实现先读取全部匹配规则后分页,建议逐页。
允许 null: False
例子: 50
获取或填写方式: 根据客户端容量选择适当正整数,如50。
pageIndex integer 可选,默认1,声明没有最小值,调用方必须选正整数。
允许 null: False
例子: 1
获取或填写方式: 从1开始按顶层pageInfo继续。

请求例子

curl --get 'https://openapi.guance.com/api/v1/logging_query_rule/list' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  --data-urlencode pageIndex=1 \
  --data-urlencode pageSize=50

响应

HTTP 200,application/json。下方示例展示可直接读取的主要字段。

字段 类型 说明
content.data array<object> 本页规则,空结果[]。
content.data[].id integer 已存在日志数据访问规则的数据库编号,调用使用uuid。
content.data[].uuid string lqrl_规则UUID,两个模块共用实体与标识。
content.data[].workspaceUUID string 本规则所属工作空间,区别来源空间。
content.data[].status integer 0启用、2禁用、3删除;本模块读取仅非删除。
content.data[].creator string 创建身份。
content.data[].updator string 最近更新身份,初始可为空。
content.data[].createAt integer 创建Unix秒。
content.data[].updateAt integer 更新Unix秒,未更新-1。
content.data[].deleteAt integer 删除Unix秒,未删除-1。
content.data[].name string 保存值:可省略;缺省/空字符串时按调用身份展示名及当前Unix秒尝试生成,修改同样重新生成,不保持旧名称。 最大64计数单位(ASCII/半角片假名1、其他字符2);启用和禁用的同类型规则都参与重名检查。
content.data[].desc string 保存值:可选,最多256同上计数单位,缺省/空串清为空;修改不是保持原值。
content.data[].indexes array 当前保存的日志索引标识数组,["*"]表示全部可用日志索引;仍受实际来源授权约束。
content.data[].indexes[] string 保存值:数组成员建议非空字符串;原声明未逐项强制,错误类型可导致500。
content.data[].roleUUIDs array 当前保存的适用角色UUID数组,["*"]为全部角色,[]不匹配任何角色;基础权限仍须独立具备。
content.data[].roleUUIDs[] string 保存值:应使用有效角色;不要使用账号UUID。
content.data[].conditions string 当前保存的日志过滤表达式,本读取不重新执行事件E查询校验。
content.data[].extend json 保存值:可选任意JSON回显,缺省{};无统一必填子键或单位,服务端不从中自动生成conditions,修改整体替换;不要存凭据。
content.data[].extend.自定义键 any 保存值:任意可序列化JSON值;不是额外生效条件。
content.data[].logic string 保存值:兼容回显字段,通常and/or;新增声明必填,修改可省略。 省略保存空串;真实生效过滤直接使用conditions,改logic不会重写条件,多角色/多规则合并不由该字段控制。
content.data[].maskFields string 保存值:可选,缺省空串不配置此规则的字段脱敏;修改省略清空。选中字段且reExprs=[]时非null值整字段遮蔽为***;给非空正则列表时只应用启用正则,全部禁用不等于整字段遮蔽。建议≤256字符以适配存储列。
content.data[].reExprs array 保存值:可选,缺省[],修改整体替换。保存时每项正则均校验,包括enable=false项;错误正则返回ft.ErrorRegularExpression。不要用单独*表示任意字符串,使用.*。选中字段无正则时整字段***;正则只处理字符串内容的匹配片段,将匹配内容替换成***;保存校验与执行引擎有差异,成功保存后仍需用代表查询验证。
content.data[].reExprs[] json 保存值:建议只使用name/enable/reExpr,数组元素原声明未强制结构,非对象可500。
content.data[].reExprs[].name string 保存值:可选回显名,不作为匹配表达式,省略不影响正则匹配。
content.data[].reExprs[].enable boolean 保存值:建议显式布尔,缺省按未启用处理;禁用正则仍必须语法合法。
content.data[].reExprs[].reExpr string 保存值:建议非空正则。当前缺省会按空串检查,不能依赖服务端补全有效表达式。
content.data[].sources array 兼容实体字段;日志专用新建保存为空数组,修改不赋值而保持已有内容,本接口不接受sources输入。
content.data[].sources[] string 保存值:按上级type解释的单个来源,建议非空字符串。
content.data[].type string 固定为logging;本日志专用接口不接受type输入。
content.data[].regionCode string 当前保存的日志来源站点代码,历史空字符串按当前站点处理;不代表新建了来源授权。
content.data[].indexWsInfo string 或 object 仅日志规则:*为全部;否则以原indexes成员为动态键;资源不存在/取不到资料时子对象可{}。
content.data[].indexWsInfo.索引标识 object 一个配置索引的空间和索引资料。
content.data[].indexWsInfo.索引标识.wsInfo object 来源空间资料,可为空对象。
content.data[].indexWsInfo.索引标识.wsInfo.uuid string 来源空间UUID。
content.data[].indexWsInfo.索引标识.wsInfo.name string 来源空间名称。
content.data[].indexWsInfo.索引标识.wsInfo.status integer 空间状态。
content.data[].indexWsInfo.索引标识.wsInfo.regionCode string 站点代码。
content.data[].indexWsInfo.索引标识.wsInfo.regionName string 或 null 站点本地化名称。
content.data[].indexWsInfo.索引标识.wsInfo.datastore object 可选,各数据类型对应存储类别映射。
content.data[].indexWsInfo.索引标识.wsInfo.datastore.数据类型 string 例如logging对应scopedb;不是可写配置。
content.data[].indexWsInfo.索引标识.wsInfo.durationSet object 可选,各数据类型保留时长。
content.data[].indexWsInfo.索引标识.wsInfo.durationSet.数据类型 string 整数+d等时长字符串;按数据域区分。
content.data[].indexWsInfo.索引标识.wsInfo.storagePolicy object 日志来源空间可选长期策略映射。
content.data[].indexWsInfo.索引标识.wsInfo.storagePolicy.数据类型 object 对应数据域长期策略。
content.data[].indexWsInfo.索引标识.wsInfo.storagePolicy.数据类型.isEnable boolean 是否开启长期策略。
content.data[].indexWsInfo.索引标识.wsInfo.storagePolicy.数据类型.duration string 长期保留时长。
content.data[].indexWsInfo.索引标识.indexInfo object 普通索引完整实体或default合成子集;历史/远端资料可缺字段,不应整体回传写入。
content.data[].indexWsInfo.索引标识.indexInfo.id integer 或 null 来源普通索引的数据库记录编号,默认索引可省略。
content.data[].indexWsInfo.索引标识.indexInfo.uuid string lgim_索引配置UUID,默认索引使用default。
content.data[].indexWsInfo.索引标识.indexInfo.workspaceUUID string 所属空间。
content.data[].indexWsInfo.索引标识.indexInfo.sourceIndexUUID string 克隆索引B的来源A UUID;普通索引为空。
content.data[].indexWsInfo.索引标识.indexInfo.name string 来源索引:当前导出索引的名称。
content.data[].indexWsInfo.索引标识.indexInfo.desc string 来源索引:当前保存的索引说明。
content.data[].indexWsInfo.索引标识.indexInfo.conditions string 来源索引:依据当前extend生成的兼容条件字符串。
content.data[].indexWsInfo.索引标识.indexInfo.sortNo integer 或 string 匹配顺序标识;原生直写或克隆通常0。
content.data[].indexWsInfo.索引标识.indexInfo.duration string 来源索引:当前保存的标准保留时长字符串,例如7d;TLS的有效阶段详见setting。
content.data[].indexWsInfo.索引标识.indexInfo.isBindCustomStore integer 或 boolean 1/true绑定外部存储。
content.data[].indexWsInfo.索引标识.indexInfo.directIndex integer 或 boolean 来源索引:当前索引是否为原生直写模式。
content.data[].indexWsInfo.索引标识.indexInfo.isFullLineIndex integer 来源索引:当前全文索引模式标记:1为全行索引,0为Message索引。
content.data[].indexWsInfo.索引标识.indexInfo.queryType string 查询类别,例如logging/standard或外部SLS返回的模式。
content.data[].indexWsInfo.索引标识.indexInfo.exterStoreProject string 外部项目/数据库标识,内部索引通常空。
content.data[].indexWsInfo.索引标识.indexInfo.exterStoreName string 外部资源名,内部通常空。
content.data[].indexWsInfo.索引标识.indexInfo.externalResourceAccessCfgUUID string 访问配置标识,不是凭据原文。
content.data[].indexWsInfo.索引标识.indexInfo.storeType string 内部索引通常空,绑定外部为实际类型。
content.data[].indexWsInfo.索引标识.indexInfo.region string 外部地域代码。
content.data[].indexWsInfo.索引标识.indexInfo.isPublicNetworkAccess integer 或 boolean 公网访问标记。
content.data[].indexWsInfo.索引标识.indexInfo.status integer 0启用、2禁用、3删除。
content.data[].indexWsInfo.索引标识.indexInfo.creator string 创建身份。
content.data[].indexWsInfo.索引标识.indexInfo.updator string 最近更新身份。
content.data[].indexWsInfo.索引标识.indexInfo.createAt integer 创建Unix秒。
content.data[].indexWsInfo.索引标识.indexInfo.updateAt integer 更新Unix秒,未更新-1。
content.data[].indexWsInfo.索引标识.indexInfo.deleteAt integer 删除Unix秒,未删除-1。
content.data[].indexWsInfo.索引标识.indexInfo.storagePolicy object 来源索引:当前保存的长期存储策略对象。
content.data[].indexWsInfo.索引标识.indexInfo.storagePolicy.longStorageEnabled boolean 来源索引:是否启用长期存储策略。
content.data[].indexWsInfo.索引标识.indexInfo.storagePolicy.longStorageDuration string 来源索引:当前配置的长期总保留时长,单位天,形如90d;关闭时可为空。
content.data[].indexWsInfo.索引标识.indexInfo.setting object 来源索引:当前保存的存储专用配置;TLS包含各阶段保留小时数。
content.data[].indexWsInfo.索引标识.indexInfo.setting.hot_retention integer 来源索引:TLS热存储阶段小时数。
content.data[].indexWsInfo.索引标识.indexInfo.setting.cold_retention integer 来源索引:TLS冷存储阶段小时数,未配置时省略。
content.data[].indexWsInfo.索引标识.indexInfo.setting.archive_retention integer 来源索引:TLS归档阶段小时数,未配置时省略。
content.data[].indexWsInfo.索引标识.indexInfo.extend object 来源索引:当前保存的匹配条件、关键字段和显示配置。
content.data[].indexWsInfo.索引标识.indexInfo.extend.matchMode string 来源索引:条件模式,basic或advanced。
content.data[].indexWsInfo.索引标识.indexInfo.extend.filters array 来源索引:basic模式的条件对象数组。
content.data[].indexWsInfo.索引标识.indexInfo.extend.filters[].name string 来源索引:条件匹配的原始字段名。
content.data[].indexWsInfo.索引标识.indexInfo.extend.filters[].condition string 来源索引:与前一条件的and/or逻辑关系,首项连接符无效。
content.data[].indexWsInfo.索引标识.indexInfo.extend.filters[].operation string 来源索引:该条件已保存的比较或匹配运算符。
content.data[].indexWsInfo.索引标识.indexInfo.extend.filters[].value array 来源索引:该条件保存的比较值数组。
content.data[].indexWsInfo.索引标识.indexInfo.extend.filters[] json 来源索引:一条basic匹配条件。
content.data[].indexWsInfo.索引标识.indexInfo.extend.filters[].value[] JSON 来源索引:一个条件值,类型按实际配置。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter json 来源索引:advanced模式的条件树根组对象。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.type string 来源索引:根组节点类型group。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.condition string 来源索引:该组子条件的and/or逻辑关系。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.filters array 来源索引:该组下的子组或条件叶子数组。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.filters[] json 来源索引:类型为rule的条件叶子或类型为group的子组。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.filters[].type string 来源索引:rule为条件叶子,group为递归子组。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.filters[].name string 来源索引:rule叶子匹配的原始字段名。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.filters[].operation string 来源索引:rule叶子保存的比较或匹配运算符。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.filters[].value array 来源索引:rule叶子的比较值数组。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.filters[].condition string 来源索引:group子组的and/or逻辑关系。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.filters[].filters array 来源索引:group子组的递归子节点数组。
content.data[].indexWsInfo.索引标识.indexInfo.extend.advancedFilter.filters[].value[] JSON 来源索引:一个条件比较值,类型按实际配置。
content.data[].indexWsInfo.索引标识.indexInfo.extend.extendFields array 来源索引:当前配置的关键字段数组。
content.data[].indexWsInfo.索引标识.indexInfo.extend.extendFields[] json 来源索引:一个关键字段及其显示别名。
content.data[].indexWsInfo.索引标识.indexInfo.extend.extendFields[].tag string 来源索引:关键字段的原始字段名。
content.data[].indexWsInfo.索引标识.indexInfo.extend.extendFields[].alias string 来源索引:关键字段的显示别名。
content.data[].indexWsInfo.索引标识.indexInfo.extend.topFields array 来源索引:当前保存的置顶字段显示配置数组。
content.data[].indexWsInfo.索引标识.indexInfo.extend.topFields[] json 来源索引:一个置顶字段显示配置。
content.data[].indexWsInfo.索引标识.indexInfo.extend.topFields[].tag string 来源索引:置顶字段的原始字段名。
content.data[].indexWsInfo.索引标识.indexInfo.extend.topFields[].alias string 来源索引:置顶字段显示别名。
content.data[].indexWsInfo.索引标识.indexInfo.extend.services array 来源索引:当前保存的服务显示信息数组,不代替索引匹配条件。
content.data[].indexWsInfo.索引标识.indexInfo.extend.services[] string 来源索引:一个服务显示值。
content.data[].indexWsInfo.索引标识.indexInfo.workspaceName string 来源空间名称,可省略。
content.data[].indexWsInfo.索引标识.indexInfo.workspaceStatus integer 来源空间状态,可省略。
content.data[].indexWsInfo.索引标识.indexInfo.regionCode string 来源站点代码。
content.data[].indexWsInfo.索引标识.indexInfo.regionName string 或 null 来源站点名称。
content.data[].indexWsInfo.索引标识.indexInfo.grantStatus integer 可选,3表示目前授权不可用;未出现不保证其他访问条件满足。
content.data[].creatorInfo object 身份摘要,无可解析资料时{}。
content.data[].creatorInfo.uuid string 身份UUID,可省略。
content.data[].creatorInfo.status integer 账号状态,可省略。
content.data[].creatorInfo.wsAccountStatus integer 成员关系状态,可省略。
content.data[].creatorInfo.name string 显示名称。
content.data[].creatorInfo.username string 登录名称。
content.data[].creatorInfo.email string 邮箱或系统身份标识。
content.data[].creatorInfo.mobile string 手机号,可空。
content.data[].creatorInfo.countryCode string 国家地区码,可省略。
content.data[].creatorInfo.iconUrl string 头像地址,可省略。
content.data[].creatorInfo.acntWsNickname string 本空间昵称,可省略。
content.data[].updatorInfo object 身份摘要,无可解析资料时{}。
content.data[].updatorInfo.uuid string 身份UUID,可省略。
content.data[].updatorInfo.status integer 账号状态,可省略。
content.data[].updatorInfo.wsAccountStatus integer 成员关系状态,可省略。
content.data[].updatorInfo.name string 显示名称。
content.data[].updatorInfo.username string 登录名称。
content.data[].updatorInfo.email string 邮箱或系统身份标识。
content.data[].updatorInfo.mobile string 手机号,可空。
content.data[].updatorInfo.countryCode string 国家地区码,可省略。
content.data[].updatorInfo.iconUrl string 头像地址,可省略。
content.data[].updatorInfo.acntWsNickname string 本空间昵称,可省略。
content.declaration object 或 null 非空业务对象附带的工作空间公共声明,未配置时可为null或空对象;空对象不添加。
pageInfo.pageIndex integer 当前页码。
pageInfo.pageSize integer 分页大小。
pageInfo.count integer 本页数量。
pageInfo.totalCount integer 非空页为匹配规则总数;当前空页提前返回时此值为0,越界页的0不能证明全局没有规则。
{
  "code": 200,
  "content": {
    "data": [
      {
        "id": 100,
        "uuid": "lqrl_example",
        "workspaceUUID": "wksp_example",
        "name": "production_only",
        "desc": "仅允许查看生产环境数据。",
        "type": "logging",
        "indexes": [
          "default"
        ],
        "sources": [],
        "roleUUIDs": [
          "role_example"
        ],
        "conditions": "`env` = 'production'",
        "extend": {},
        "logic": "and",
        "maskFields": "message",
        "reExprs": [
          {
            "name": "token",
            "enable": true,
            "reExpr": "tkn_[0-9A-Za-z]+"
          }
        ],
        "regionCode": "",
        "status": 0,
        "creator": "wsak_example",
        "updator": "",
        "createAt": 1785427200,
        "updateAt": -1,
        "deleteAt": -1,
        "indexWsInfo": {
          "default": {
            "wsInfo": {},
            "indexInfo": {}
          }
        },
        "creatorInfo": {},
        "updatorInfo": {}
      }
    ],
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE",
  "pageInfo": {
    "pageIndex": 1,
    "pageSize": 50,
    "count": 1,
    "totalCount": 1
  }
}

错误响应

鉴权、限流和公共请求错误参见公共错误定义。

HTTP 状态 errorCode 触发条件 消息或响应说明 处理方式
406 ft.ParameterValidationFailed 使用未声明的 Query 参数或参数违反规则 参数解析失败 核对 Query 参数表及示例。
404 ft.NoInitOtherNodeCfg 读取或校验远端索引/来源日志索引元数据时未找到可用来源站点地址 未初始化其他节点配置 由管理员核对来源站点配置、可访问地址及有效跨空间授权,修复后重试。
500 ft.InternalServerError 规则、角色、来源空间或索引/应用元数据读取与格式化失败 内部错误 刷新已授权来源及站点信息,稍后重试;持续失败提供traceId。

文档评价

文档内容是否对您有帮助?