日志审计日志查询

最近更新时间:2024-11-03 18:07:41

我的收藏

1. 接口描述

接口请求域名: cfw.tencentcloudapi.com 。

日志审计日志查询

默认接口请求频率限制:5次/秒。

推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:DescribeLogs。
Version String 公共参数,本接口取值:2019-09-04。
Region String 公共参数,本接口不需要传递此参数。
Index String 日志类型标识
流量日志:互联网边界防火墙netflow_border,NAT边界防火墙netflow_nat,VPC间防火墙vpcnetflow,内网流量日志netflow_fl
入侵防御日志rule_threatinfo
访问控制日志:互联网边界规则rule_acl,NAT边界规则rule_acl,内网间规则rule_vpcacl,企业安全组rule_sg
操作日志:防火墙开关-开关操作operate_switch,防火墙开关-实例配置operate_instance,资产中心操作operate_assetgroup,访问控制操作operate_acl,零信任防护操作operate_identity,入侵防御操作-入侵防御operate_ids,入侵防御操作-安全基线operate_baseline,常用工具操作operate_tool,网络蜜罐操作operate_honeypot,日志投递操作operate_logdelivery,通用设置操作operate_logstorage,登录日志operate_login
示例值:netflow_border
Limit Integer 每页条数,最大支持2000
示例值:10
Offset Integer 偏移值,最大支持60000
示例值:0
StartTime String 筛选开始时间
示例值:2021-09-21 12:00:00
EndTime String 筛选结束时间
示例值:2021-09-21 12:00:00
Filters.N Array of CommonFilter 过滤条件组合,各数组元素间为AND关系,查询字段名Name参考文档https://cloud.tencent.com/document/product/1132/87894,数值类型字段不支持模糊匹配
示例值:[{"Name":"common","OperatorType":9,"Values":["122.152.224.50"]}]

3. 输出参数

参数名称 类型 描述
Data String 日志列表
示例值:{"AppProtocolList":null,"Data":"[{"StartTime":"2024-11-0115:20:00","EndTime":"2024-11-0115:23:01","SourceIp":"1.1.1.1","TargetIp":"1.1.1.1","SourcePrivateId":"vpc-2d8akqf5","TargetPrivateId":"vpc-n0nyt8w7","SourcePort":"59000","TargetPort":"5001","Direction":"1","Domain":"","Protocol":"TCP","SwitchId":"cfws-4177e03f66","SwtichName":"cfws-4177e03f66-switch1","InstName":"","InstanceID":"","ReceivePackageNum":1139962,"ReceiveBytesNum":1655072852,"SendPackageNum":115493,"SendBytesNum":8315616,"FlowPackageNum":1255455,"FlowBytesNum":1663388468,"SourcePrivateName":"dora--IPV6-1","TargetPrivateName":"dora-IPV6-2","SourceInsName":"性能客户端","TargetInsName":"性能服务端","SrcInsID":"ins-muctdnk4","DstInsID":"ins-q8vss5oq","Address":"","Supplier":"","PublicIp":"","PublicPort":"","FwGroupId":"cfwg-dc7c585f","FwGroupName":"-性能测试"}]","RequestId":"8d7fc0ae-ba1a-45d1-b33d-14c24dafc233","ReturnCode":0,"ReturnMsg":"success","Total":74128060}
Total Integer 总条数
示例值:100
ReturnCode Integer 返回状态码 0 成功 非0不成功
示例值:0
ReturnMsg String 返回信息 success 成功 其他 不成功
示例值:success
AppProtocolList Array of String 七层协议,NTA日志有效
示例值:["TCP"]
RequestId String 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。

4. 示例

示例1 日志审计日志查询

日志审计日志查询

输入示例

POST / HTTP/1.1
Host: cfw.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeLogs
<公共请求参数>

{
    "Filters": [
        {
            "Name": "protocol",
            "Values": [
                "ANY",
                "TCP",
                "ICMP"
            ],
            "OperatorType": 1
        }
    ],
    "Limit": 10,
    "Offset": 0,
    "Index": "netflow_border",
    "StartTime": "2021-09-21 12:00:00",
    "EndTime": "2021-09-21 12:00:00"
}

输出示例

{
    "Response": {
        "Data": "[{\"StartTime\":\"2024-09-21 12:00:00\",\"EndTime\":\"2024-09-21 12:01:00\",\"SourceIp\":\"91.148.190.158\",\"TargetIp\":\"81.70.48.154\",\"SourcePort\":\"50865\",\"TargetPort\":\"17589\",\"Direction\":\"1\",\"Domain\":\"\",\"Protocol\":\"TCP\",\"Address\":\"保加利亚索非亚州索非亚\",\"Supplier\":\"Tamatiya EOOD\",\"AssetName\":\"\",\"ReceivePackageNum\":1,\"ReceiveBytesNum\":44,\"SendPackageNum\":0,\"SendBytesNum\":0,\"FlowPackageNum\":1,\"FlowBytesNum\":44,\"AssetId\":\"\",\"Tags\":\"\"},{\"StartTime\":\"2024-09-21 12:00:00\",\"EndTime\":\"2024-09-21 12:00:11\",\"SourceIp\":\"80.64.30.109\",\"TargetIp\":\"81.70.41.63\",\"SourcePort\":\"42573\",\"TargetPort\":\"38847\",\"Direction\":\"1\",\"Domain\":\"\",\"Protocol\":\"TCP\",\"Address\":\"俄罗斯莫斯科\",\"Supplier\":\"Hivelocity Inc\",\"AssetName\":\"\",\"ReceivePackageNum\":2,\"ReceiveBytesNum\":80,\"SendPackageNum\":1,\"SendBytesNum\":40,\"FlowPackageNum\":3,\"FlowBytesNum\":120,\"AssetId\":\"\",\"Tags\":\"\"},{\"StartTime\":\"2024-09-21 12:00:00\",\"EndTime\":\"2024-09-21 12:01:00\",\"SourceIp\":\"91.148.190.158\",\"TargetIp\":\"81.70.48.154\",\"SourcePort\":\"50865\",\"TargetPort\":\"17589\",\"Direction\":\"1\",\"Domain\":\"\",\"Protocol\":\"TCP\",\"Address\":\"保加利亚索非亚州索非亚\",\"Supplier\":\"Tamatiya EOOD\",\"AssetName\":\"league-规则测试靶机-勿删\",\"ReceivePackageNum\":1,\"ReceiveBytesNum\":44,\"SendPackageNum\":0,\"SendBytesNum\":0,\"FlowPackageNum\":1,\"FlowBytesNum\":44,\"AssetId\":\"ins-mec2asax\",\"Tags\":\"\"},{\"StartTime\":\"2024-09-21 12:00:00\",\"EndTime\":\"2024-09-21 12:00:11\",\"SourceIp\":\"89.248.165.16\",\"TargetIp\":\"81.70.41.63\",\"SourcePort\":\"52015\",\"TargetPort\":\"38433\",\"Direction\":\"1\",\"Domain\":\"\",\"Protocol\":\"TCP\",\"Address\":\"荷兰北荷兰省阿姆斯特丹\",\"Supplier\":\"IP Volume inc\",\"AssetName\":\"\",\"ReceivePackageNum\":2,\"ReceiveBytesNum\":88,\"SendPackageNum\":1,\"SendBytesNum\":40,\"FlowPackageNum\":3,\"FlowBytesNum\":128,\"AssetId\":\"\",\"Tags\":\"\"},{\"StartTime\":\"2024-09-21 12:00:00\",\"EndTime\":\"2024-09-21 12:00:11\",\"SourceIp\":\"80.64.30.109\",\"TargetIp\":\"81.70.41.63\",\"SourcePort\":\"42573\",\"TargetPort\":\"38847\",\"Direction\":\"1\",\"Domain\":\"\",\"Protocol\":\"TCP\",\"Address\":\"俄罗斯莫斯科\",\"Supplier\":\"Hivelocity Inc\",\"AssetName\":\"ins-r0jh352d\",\"ReceivePackageNum\":2,\"ReceiveBytesNum\":80,\"SendPackageNum\":1,\"SendBytesNum\":40,\"FlowPackageNum\":3,\"FlowBytesNum\":120,\"AssetId\":\"ins-r0jh352d\",\"Tags\":\"\"},{\"StartTime\":\"2024-09-21 12:00:00\",\"EndTime\":\"2024-09-21 12:00:11\",\"SourceIp\":\"89.248.165.16\",\"TargetIp\":\"81.70.41.63\",\"SourcePort\":\"52015\",\"TargetPort\":\"38433\",\"Direction\":\"1\",\"Domain\":\"\",\"Protocol\":\"TCP\",\"Address\":\"荷兰北荷兰省阿姆斯特丹\",\"Supplier\":\"IP Volume inc\",\"AssetName\":\"ins-r0jh352d\",\"ReceivePackageNum\":2,\"ReceiveBytesNum\":88,\"SendPackageNum\":1,\"SendBytesNum\":40,\"FlowPackageNum\":3,\"FlowBytesNum\":128,\"AssetId\":\"ins-r0jh352d\",\"Tags\":\"\"}]",
        "RequestId": "e368c536-0331-46d3-b888-90c27152970f",
        "ReturnCode": 0,
        "ReturnMsg": "success",
        "Total": 0
    }
}

5. 开发者资源

腾讯云 API 平台

腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。

API Inspector

用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。

SDK

云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

命令行工具

6. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

错误码 描述
InternalError 内部错误。
InvalidParameterValue 参数取值错误。
LimitExceeded 超过配额限制。
RequestLimitExceeded 请求的次数超过了频率限制。
ResourceNotFound 资源不存在。
ResourceUnavailable 资源不可用。
UnknownParameter 未知参数错误。