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

获取Bot事件日志数据

更新时间:2022-09-02 16:59:43

适用产品

BotGuard爬虫管理

接口描述

获取触发规则TOP数据

推荐使用 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
Stringurl
referer
Stringreferer
statusCode
String状态码
userAgent
StringuserAgent
uuid
String事件ID
pageSize
Integer每页记录数
currentPage
Integer当前页码
clientId
String客户端ID
browserFp
String浏览器指纹
ruleName
String规则名
botRuleName
Stringbot规则名
ipCondition
Integer查询匹配条件 1-相等 2-不相等 3-包含 4-不包含,默认3
urlCondition
Integer查询匹配条件 1-相等 2-不相等 3-包含 4-不包含,默认3
refererCondition
Integer查询匹配条件 1-相等 2-不相等 3-包含 4-不包含,默认3
statusCodeConditon
Integer查询匹配条件 1-相等 2-不相等 3-包含 4-不包含,默认3
userAgentCondition
Integer查询匹配条件 1-相等 2-不相等 3-包含 4-不包含,默认3

返回参数

Body 参数

参数名称类型描述
code
Integer状态码,成功为“200”。
message
String返回信息,成功为“Success”。
data
GetBotEventLogDataResponseData返回数据
currentPage
Integer当前页码
firstPage
Integer首页页码
lastPage
Integer末页页码
pageSize
Integer每页记录数
totalCount
Long总记录数
totalPageCount
Integer总页数
list
List结果数据
referer
String浏览器referer
browser_fp
String浏览器指纹
attack_type
String攻击类型
rule_name
String规则名称
ip
Stringip
uuid
String事件ID
version
String版本号
client_id
String客户端ID
url
Stringurl
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
StringuserAgent
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"  \
-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"
}
本篇文档内容对您是否有帮助?
有帮助
没帮助
提交成功!非常感谢您的反馈,我们会继续努力做到更好!