Help Center/ Edge Security/ API Reference/ API/ HTTP Statistics/ Querying HTTP Attack Distribution Data
Updated on 2026-09-16 GMT+08:00

Querying HTTP Attack Distribution Data

Function

This API is used to query HTTP attack distribution data.

URI

GET /v1/edgesec/stat/http-attack-distribution

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Obtain the enterprise project ID by calling the ListEnterpriseProject API of Enterprise Project Management Service (EPS). The default value is 0.

domain_name

No

String

Domain name.

stat_type

Yes

String

Type of a security statistic metric.

For example, req_num (number of requests) and bw (bandwidth). Currently, only req_num is supported.

group_by

Yes

String

Currently, the value can be action (protection action) or attack_type (attack type).

start_time

Yes

Long

Start time, which is a timestamp in seconds.

end_time

Yes

Long

End time, which is a timestamp in seconds.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Tenant token

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

stat_type

String

Security statistics metric type

group_by

String

Statistics grouping dimension

stat_num

Long

Statistical quantity

values

Array of CommonStatItem objects

Statistics array

start_time

Long

Start time

end_time

Long

End time

Table 4 CommonStatItem

Parameter

Type

Description

key

String

Subcategory corresponding to the request parameter group_by. For example, in the API for querying the HTTP attack distribution statistics, if group_by is action, the key can be log, block, captcha, or js_challenge. In the API for querying top HTTP attack statistics, if group_by is url, the key can be the requested URL, for example, /abc.

value

Long

Number of attack requests

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error description

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error description

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error description

Example Requests

  • Query the distribution data of HTTP attack protection actions

    GET https://esa.cn-north-4.myhuaweicloud.com/v1/edgesec/stat/http-attack-distribution?enterprise_project_id=0&start_time=1731427200000&end_time=1731427500000&stat_type=req_num&group_by=action&domain_name=www.test.com
  • Query the distribution data of HTTP attack types

    GET https://esa.cn-north-4.myhuaweicloud.com/v1/edgesec/stat/http-attack-distribution?enterprise_project_id=0&start_time=1731427200000&end_time=1731427500000&stat_type=req_num&group_by=attack_type&domain_name=www.test.com

Example Responses

Status code: 200

  • Query the distribution data of HTTP attack protection actions

    [ {
      "stat_type" : "req_num",
      "group_by" : "action",
      "stat_num" : 200,
      "start_time" : 1731427200000,
      "end_time" : 1731427500000,
      "values" : [ {
        "key" : "log",
        "value" : 100
      }, {
        "key" : "block",
        "value" : 100
      } ]
    } ]
  • Query the distribution data of HTTP attack types

    [ {
      "stat_type" : "req_num",
      "group_by" : "attack_type",
      "stat_num" : 200,
      "start_time" : 1731427200000,
      "end_time" : 1731427500000,
      "values" : [ {
        "key" : "sqli",
        "value" : 100
      }, {
        "key" : "cc",
        "value" : 100
      } ]
    } ]

Status Codes

Status Code

Description

200

Request successful.

400

Request failed.

401

The token does not have required permissions.

500

Internal server error.

Error Codes

See Error Codes.