Querying Statistics of Top Exceptions
Function
This API is used to query top service exceptions, such as abnormal requests or errors.
URI
GET /v1/{project_id}/waf/overviews/abnormal
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. To obtain it, go to Cloud management console and hover the cursor over your username. On the displayed window, choose My Credentials.Then, in the Projects area, view Project ID of the corresponding project. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
You can obtain the ID by calling the ListEnterpriseProject API of EPS. |
from |
Yes |
Long |
Start time (13-digit timestamp in millisecond). This parameter must be used together with to. |
to |
Yes |
Long |
End time (13-digit timestamp in millisecond). This parameter must be used together with from. |
top |
No |
Integer |
Top N results to be queried. The default value is 5, and the maximum value is 10. |
code |
No |
Integer |
Error code to be queried. Currently, 404, 500, and 502 are supported. If this parameter is not specified, status code 404 is queried by default. |
hosts |
No |
String |
Domain name IDs. In the cloud mode, domain name IDs can be obtained by calling the ListHost API. In the dedicated mode, domain name IDs can be obtained by calling the ListPremiumHost API. By default, this parameter is not required, and the statistics data of all protected domain names in the project is queried. |
instances |
No |
String |
Instance IDs you want to query. This parameter is required only for dedicated WAF instances and load-balancing instances (ELB mode). |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
Content-Type |
Yes |
String |
Content type. Default: application/json;charset=utf8 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total |
Integer |
Number of abnormal requests |
items |
Array of UrlCountItem objects |
Array of abnormal request information. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Attack Type. |
num |
Integer |
Quantity. |
host |
String |
Protected domain names |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error message |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error message |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error message |
Example Requests
The following example shows how to query the number of 404 errors and top exceptions. The project ID is specified by project_id and the time is from 2022-04-21 00:00:00 to 2022-04-21 14:35:36.
GET https://{Endpoint}/v1/{project_id}/waf/overviews/abnormal?enterprise_project_id=0&from=1650470400089&to=1650523520089&top=10&code=404
Example Responses
Status code: 200
ok
{ "total" : 2, "items" : [ { "key" : "/", "num" : 6, "host" : "hkh4.test.418lab.cn" }, { "key" : "/", "num" : 6, "host" : "ces_after.test.418lab.cn" } ] }
Status Codes
Status Code |
Description |
---|---|
200 |
ok |
400 |
Request failed. |
401 |
The token does not have required permissions. |
500 |
Internal server error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.