• Web Application Firewall

waf
  1. Help Center
  2. Web Application Firewall
  3. API Reference
  4. APIs
  5. Event Logs
  6. Querying Request Statistics and Attack Statistics in a Specified Time Range

Querying Request Statistics and Attack Statistics in a Specified Time Range

Function Description

This API is used to query request statistics and attack statistics in a specified time range.

URI

  • URI format

    GET /v1/{project_id}/waf/event/timeline?from={from}&to={to}&timezone={timezone}&hosts={hostids}

  • Parameter description
    Table 1 Path parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Specifies the project ID.

    from

    Yes

    Long

    Specifies the start time (UTC) in milliseconds. For example, 1548172800000.

    to

    Yes

    Long

    Specifies the end time (UTC) in milliseconds. For example, 1548431999000.

    timezone

    No

    String

    Specifies the time zone. For example, the time zone of London is +00:00 and that of Beijing is +08:00. The default value is +00:00.

    hosts

    No

    Array

    Specifies the domain IDs.

Request

Request parameters

None

Response

Response parameters
Table 2 Parameter description

Parameter

Type

Description

requests

Table 3

Specifies request statistics.

attacks

Table 4

Specifies attack statistics.

Table 3 requests

Parameter

Type

Description

time

Integer

Specifies the end time since Unix Epoch in milliseconds.

num

Integer

Specifies the number of requests.

Table 4 attacks

Parameter

Type

Description

time

Integer

Specifies the end time since Unix Epoch in milliseconds.

num

Integer

Specifies the number of attacks.

Example

Response example
{
  "requests": [
        {"time": 1499817600, "num": 123400},
        {"time": 1499817601, "num": 123401},
        {"time": 1499817602, "num": 123402}
  ],
  "attacks": [
        {"time": 1499817600, "num": 1234},
        {"time": 1499817601, "num": 1235},
        {"time": 1499817602, "num": 1236}
  ]
}

Status Code

Table 5 describes the normal status code returned by the API.
Table 5 Status code

Status Code

Description

Meaning

200

OK

The request has succeeded.

For details about error status codes, see Status Codes.