文档中心 API文档 获取Bot事件日志数据

获取Bot事件日志数据

更新时间:2023-02-03 10:24:14

适用产品

BotGuard爬虫管理

接口描述

获取Bot事件日志数据

调用频率

单用户调用频率:300/5min

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Body 参数

参数名称类型必填描述
domain
String域名。多个以;隔开。
startTime
String开始时间。格式: yyyy-MM-dd HH:mm:ss
endTime
String结束时间。格式: yyyy-MM-dd HH:mm:ss
timeZone
Integer时区,默认8,即“GTM+8”
lang
String语言类型。 默认cn en:英文 cn:中文
attackType
String攻击类型。多个以;隔开。
act
String处理动作。 1:拦截 2:监控 7:攻击标记 8:验证码
location
StringIP地理位置。
ip
String客户端IP。
url
StringURI。
referer
StringReferer。
statusCode
String状态码。
userAgent
StringUser-Agent。
uuid
String事件ID。
pageSize
Integer每页显示的条目数。最大限制10,000。
currentPage
Integer当前页码。
clientId
String客户端ID。
browserFp
String浏览器指纹。
ruleName
String规则名。
botRuleName
StringBot规则名。
ipCondition
Integer'客户端IP'查询条件匹配方式。默认值:3。 1:相等 2:不相等 3:包含 4:不包含
urlCondition
Integer'客户端URL'查询条件匹配方式。默认值:3。 1:相等 2:不相等 3:包含 4:不包含
refererCondition
Integer'客户端Rerfer'查询条件匹配方式。默认值:3。 1:相等 2:不相等 3:包含 4:不包含
statusCodeConditon
Integer'客户端状态码'查询条件匹配方式。默认值:3。 1:相等 2:不相等 3:包含 4:不包含
userAgentCondition
Integer'客户端UA'查询条件匹配方式。默认值:3。 1:相等 2:不相等 3:包含 4:不包含

返回参数

Body 参数

参数名称类型描述
code
String状态码,成功为“200”。
message
String返回信息,成功为“Success”。
data
Object返回数据
currentPage
Integer当前页码。
firstPage
Integer首页页码。
lastPage
Integer末页页码。
pageSize
Integer每页显示的条目数。最大限制10,000。
totalCount
Long总条目数。最大限制1,000,000。
totalPageCount
Integer总页数。
list
List数据列表
referer
StringReferer。
browser_fp
String浏览器指纹。
attack_type
String攻击类型。
rule_name
String规则名称。
ip
StringIP。
uuid
String事件ID。
version
String版本号。
client_id
String客户端ID。
url
StringURI。
block_id
StringBlock id。
content
String内容。
mode
String请求方法。
final_rule_id
Integer规则id。
event_type
String事件类型。
act
String处理动作。
zone
String时区。
attack_time
String攻击时间
strategy_desc
String策略描述。。
host
String域名。
location
StringIP地理位置。
strategy_name
String策略名称。
user_agent
StringUser-Agent
detail_host
String域名详情。
statusCode
Integer状态码。

错误码

错误代码(code)描述(message)HTTP状态码语义
22994001CUSTOMER_NOT_EXIST200客户不存在
22994000PARAM_ERROR_CODE 200查询参数错误
22995000INTERNAL_ERROR_CODE 200系统错误

示例

JSON
JSON
请求示例
复制代码 复制成功
#!/bin/bash
username="example_username"
apiKey="example_apiKey" 
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url https://open.chinanetcenter.com/api/bot/report/event-log \
-X "POST"  \
-u "$username:$password"  \
-H "Date: $date"   \
-H "Accept: application/json"  \
-H "Content-Type: application/json" \
-d {
    "domain": "example1.xxx.xxx;example2.xxx.xxx;example3.xxx.xxx;",
    "startTime": "2021-12-01 00:00:00",
    "endTime": "2021-12-31 00:00:00",
    "act": "1",
    "attackType":"BOT_ENVABN",
    "ip": "10.8.174.24",
    "url": "/test01.php"
}
返回示例
复制代码 复制成功
{
    "code": 200,
    "data": {
        "currentPage": 1,
        "firstPage": 1,
        "lastPage": 1,
        "list": [
            {
                "referer": "-",
                "browser_fp": "",
                "attack_type": "BOT_ENVABN",
                "rule_name": "",
                "ip": "10.8.174.24",
                "uuid": "bd44680719164076288390e6a8b6",
                "version": "HTTP/1.1",
                "client_id": "-",
                "url": "/test01.php",
                "block_id": "",
                "content": "offline blacklist type:BOT_ENVABN, info:The environment of client is abnormal.[finger], block time 18.743000030518",
                "mode": "GET",
                "final_rule_id": 3550,
                "event_type": "type1",
                "act": "action1",
                "zone": "",
                "attack_time": "2021-12-29 15:28:03",
                "strategy_desc": "description",
                "host": "localapp.sec.sec.haplat.net",
                "location": "  ",
                "strategy_name": "name",
                "user_agent": "WsSecurityDemo/21.1222.0 CFNetwork/1240.0.4 Darwin/20.6.0",
                "detail_host": "localapp.sec.sec.haplat.net",
                "statusCode": 403
            },
            {
                "referer": "-",
                "browser_fp": "",
                "attack_type": "BOT_ENVABN",
                "rule_name": "",
                "ip": "10.8.174.24",
                "uuid": "af57490421164076281090e6a8b6",
                "version": "HTTP/1.1",
                "client_id": "-",
                "url": "/test01.php",
                "block_id": "",
                "content": "offline blacklist type:BOT_ENVABN, info:The environment of client is abnormal.[finger], block time 18.848999977112",
                "mode": "GET",
                "final_rule_id": 3550,
                "event_type": "type",
                "act": "action",
                "zone": "",
                "attack_time": "2021-12-29 15:26:50",
                "strategy_desc": "description",
                "host": "localapp.sec.sec.haplat.net",
                "location": "  ",
                "strategy_name": "name",
                "user_agent": "WsSecurityDemo/21.1222.0 CFNetwork/1240.0.4 Darwin/20.6.0",
                "detail_host": "localapp.sec.sec.haplat.net",
                "statusCode": 403
            },
            {
                "referer": "-",
                "browser_fp": "",
                "attack_type": "BOT_ENVABN",
                "rule_name": "",
                "ip": "10.8.174.24",
                "uuid": "452a7bd091164057166590e6a8b6",
                "version": "HTTP/1.1",
                "client_id": "-",
                "url": "/test01.php",
                "block_id": "",
                "content": "offline blacklist type:BOT_ENVABN, info:The environment of client is abnormal.[hook], block time 14.267999887466",
                "mode": "GET",
                "final_rule_id": 3550,
                "event_type": "type",
                "act": "action",
                "zone": "",
                "attack_time": "2021-12-27 10:21:05",
                "strategy_desc": "description",
                "host": "localapp.sec.sec.haplat.net",
                "location": "  ",
                "strategy_name": "name",
                "user_agent": "WsSecurityDemo/21.1222.0 CFNetwork/1240.0.4 Darwin/20.6.0",
                "detail_host": "localapp.sec.sec.haplat.net",
                "statusCode": 403
            }
        ],
        "pageSize": 10,
        "totalCount": 3,
        "totalPageCount": 1
    },
    "message": "Success"
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!