Queries the top N statistics for all traffic, including malicious and normal service requests. The results are aggregated by different dimensions and sorted in descending order.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-waf:DescribeNetworkFlowTopNMetric |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the WAF instance. Note
You can call the DescribeInstance operation to query the ID of the WAF instance. |
waf_cdnsdf3**** |
| Filter |
object |
Yes |
The filter conditions for the query. Multiple filter conditions have a logical AND relationship. |
|
| DateRange |
object |
Yes |
The time range to query. |
|
| StartDate |
integer |
Yes |
The start of the time range to query. The range cannot exceed the last 30 days. Specify the time in the UNIX timestamp format. Unit: seconds. Note
The start time must be later than 30 days before the current time. |
1713888000 |
| EndDate |
integer |
Yes |
The end of the time range to query. Specify the time in the UNIX timestamp format. Unit: seconds. |
1713888600 |
| Conditions |
array |
No |
A list of filter conditions. Each node specifies a filter condition. |
|
|
object |
No |
The configuration of a single filter condition. A filter condition consists of a field name, an operator, and a filter value. For more information about the supported field names and operators, see the Additional information about request parameters section. |
||
| Key |
string |
No |
The field to filter. This parameter supports the following fields:
|
matched_host |
| OpValue |
string |
No |
The operator. |
eq |
| Values |
any |
No |
The filter value. |
test.waf-top |
| Limit |
integer |
Yes |
The number of entries to return. The data is sorted in descending order. The maximum value is 10. |
10 |
| Metric |
string |
Yes |
The metric that you want to use to query data. Different metrics correspond to different data. This parameter supports the following metrics:
|
matched_host_by_upstream_status |
| RegionId |
string |
No |
The region where the WAF instance resides. Valid values:
|
cn-hangzhou |
| ResourceManagerResourceGroupId |
string |
No |
The ID of the Alibaba Cloud resource group. |
rg-acfm***q |
Description of operators
| Operator | Meaning | Description |
| all-not-match | Does not equal any of the values | The field value is not equal to any value in the collection. For example, to filter real_client_ip addresses that are not equal to any value in a collection:{"Key":"real_client_ip","OpValue":"all-not-match","Values":["1.XX.XX.1","2.XX.XX.2","3.XX.XX.3"]} |
| eq | Equals | The field value is equal to a string. For example, to filter statistics for which the URL is "/testcase":{"Key":"request_path","OpValue":"eq","Values":"/testcase"} |
| match-one | Equals one of the values | The field value is equal to any value in the collection. For example, to filter real_client_ip addresses that are equal to any value in a collection:{"Key":"real_client_ip","OpValue":"match-one","Values":["1.XX.XX.1","2.XX.XX.2","3.XX.XX.3"]} |
| ne | Does not equal | The field value is not equal to a string. For example, to filter statistics for which the URL is not "/testcase":{"Key":"request_path","OpValue":"ne","Values":"/testcase"} |
Supported keys for filter conditions
| Field name | Field description | Supported operators |
| cluster | The protection cluster. | ne, eq, match-one, all-not-match |
| matched_host | The protected object. | ne, eq, match-one, all-not-match |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. For more information about the format, see the Examples section. |
||
| RequestId |
string |
The request ID. |
D827FCFE-90A7-4330-9326-******4C7726 |
| NetworkFlowTopNValues |
array<object> |
An array of the top N statistics. |
|
|
object |
Each entry in the array represents a top N statistic. |
||
| Name |
string |
The value of a field. The meaning of this parameter varies based on the value of the Metric request parameter. |
127.0.0.1 |
| Attribute |
string |
Additional information. For example, this parameter can indicate the country or province to which an IP address belongs. |
CN |
| Value |
integer |
The statistical count that is used for top N sorting. |
1123 |
| TopNMetaData |
object |
The metadata of the returned data. |
|
| DateRange |
object |
The time range that you specified for the query. |
|
| StartDate |
integer |
The start of the time range to query. This value is a UNIX timestamp. Unit: seconds. This value is the same as the StartDate request parameter. |
1713888000 |
| EndDate |
integer |
The end of the time range to query. This value is a UNIX timestamp. Unit: seconds. This value is the same as the EndDate request parameter. |
1713888600 |
| Units |
string |
The unit of the returned statistical data. |
requests |
Examples
Success response
JSON format
{
"RequestId": "D827FCFE-90A7-4330-9326-******4C7726",
"NetworkFlowTopNValues": [
{
"Name": "127.0.0.1",
"Attribute": " CN",
"Value": 1123
}
],
"TopNMetaData": {
"DateRange": {
"StartDate": 1713888000,
"EndDate": 1713888600
},
"Units": "requests\n"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Waf.Report.%s | Invalid parameter:%s. | Invalid parameter:%s |
| 400 | Waf.Report.InternalError | Server error occurred in report service. | Report Service Internal Error |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.