Queries the top N statistics for all traffic that passes through Web Application Firewall (WAF), 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. If you specify multiple filter conditions, all conditions must be met (logical AND). |
|
| DateRange |
object |
Yes |
The time range to query. |
|
| StartDate |
integer |
Yes |
The beginning of the time range to query. This value is a UNIX timestamp. Unit: seconds. The time range cannot exceed the last 30 days. 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. This value is a UNIX timestamp. Unit: seconds. |
1713888600 |
| Conditions |
array |
No |
The list of filter conditions. |
|
|
object |
No |
A single filter condition. A filter condition consists of a field name (Key), an operator (OpValue), and a filter value (Values). For more information about supported field names and operators, see the Additional information about request parameters section. |
||
| Key |
string |
No |
The field name to use for filtering. Valid values:
|
matched_host |
| OpValue |
string |
No |
The operator that is used for the filter condition. For more information about supported operators, see the Additional information about request parameters section. |
eq |
| Values |
any |
No |
The value to use for the filter condition. The value format depends on the Key and OpValue that you specify. |
test.waf-top |
| Limit |
integer |
Yes |
The maximum number of entries to return. Results are sorted in descending order. Maximum value: 10. |
10 |
| Metric |
string |
Yes |
The metric by which to query and rank data. Valid values:
|
matched_host_by_upstream_status |
| RegionId |
string |
No |
The region in which 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 of the specified values. For example, to exclude requests from specific source IP addresses:{"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 equals the specified string. For example, to query statistics for requests with the URL path "/testcase":{"Key":"request_path","OpValue":"eq","Values":"/testcase"} |
| match-one | Equals one of the values | The field value equals one of the specified values. For example, to query statistics for requests from specific source IP addresses:{"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 does not equal the specified string. For example, to exclude requests with the URL path "/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 response body. For more information about the format, see the Examples section. |
||
| RequestId |
string |
The ID of the request. |
D827FCFE-90A7-4330-9326-******4C7726 |
| NetworkFlowTopNValues |
array<object> |
An array of the top N statistics. |
|
|
object |
A single entry in the top N ranking results. |
||
| Name |
string |
The dimension value that corresponds to the specified Metric request parameter. For example, if the Metric is set to real_client_ip, this parameter indicates the source IP address. |
127.0.0.1 |
| Attribute |
string |
The additional attribute associated with the entry. For example, when the Metric is set to real_client_ip, this parameter indicates the country or region to which the IP address belongs. |
CN |
| Value |
integer |
The total number of requests or the QPS value, depending on the specified Metric. This value is used for top N ranking. |
1123 |
| TopNMetaData |
object |
The metadata of the returned data. |
|
| DateRange |
object |
The time range used for the query. |
|
| StartDate |
integer |
The beginning of the time range. This value is a UNIX timestamp. Unit: seconds. |
1713888000 |
| EndDate |
integer |
The end of the time range. This value is a UNIX timestamp. Unit: seconds. |
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.