GET
/
cdn
/
advanced
/
v1
/
logs
Get CDN logs
curl --request GET \
  --url https://api.gcore.com/cdn/advanced/v1/logs \
  --header 'Authorization: <api-key>'
{
  "data": [
    {
      "timestamp": 1633914371,
      "client_ip": "1.1.1.1",
      "cname": "test.domain.com",
      "resource_id": 100,
      "path": "/awesome-site",
      "method": "GET",
      "user_agent": "Mozilla/5.0 (compatible; MSIE 6.0; Windows 95; Trident/3.1)",
      "status": 200,
      "size": 17340162,
      "cache_status": "HIT",
      "datacenter": "m9",
      "referer": "https://www.test.com/",
      "sent_http_content_type": "image/jpeg",
      "tcpinfo_rtt": 70
    }
  ],
  "meta": {
    "count": 129874732
  }
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Query Parameters

from
string
required

Start date and time of the requested time period (ISO 8601/RFC 3339 format, UTC.)

Difference between "from" and "to" cannot exceed 6 hours.

Examples: * &from=2021-06-14T00:00:00Z * &from=2021-06-14T00:00:00.000Z

to
string
required

End date and time of the requested time period (ISO 8601/RFC 3339 format, UTC.)

Difference between "from" and "to" cannot exceed 6 hours.

Examples: * &to=2021-06-15T00:00:00Z * &to=2021-06-15T00:00:00.000Z

offset
integer
default:0

Number of log records to skip starting from the beginning of the requested period.

limit
integer
default:100

Maximum number of log records in the response.

Required range: 1 <= x <= 1000
ordering
string

Sorting rules.

Possible values:

  • method - Request HTTP method.
  • client_ip - IP address of the client who sent the request.
  • status - Status code in the response.
  • size - Response size in bytes.
  • cname - Custom domain of the requested resource.
  • resource_id - ID of the requested CDN resource.
  • cache_status - Caching status.
  • datacenter - Data center where request was processed.
  • timestamp - Date and time when the request was made.

Parameter may have multiple values separated by a comma.

By default, ascending sorting is applied. To sort in descending order, add '-' prefix.

Example: * &ordering=-timestamp,status

fields
string
default:timestamp,path,method,referer,user_agent,client_ip,status,size,cname,resource_id,cache_status,datacenter,sent_http_content_type,tcpinfo_rtt

A comma-separated list of returned fields.

Supported fields are presented in the responses section.

Example: * &fields=timestamp,path,status

method__eq
string

Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'.

method__ne
string

Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'.

method__in
string

Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'. Values should be separated by a comma.

method__not_in
string

Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'. Values should be separated by a comma.

client_ip__eq
string

IP address of the client who sent the request.

client_ip__ne
string

IP address of the client who did not send the request.

client_ip__in
string

List of IP addresses of the clients who sent the request.

client_ip__not_in
string

List of IP addresses of the clients who did not send the request.

status__gt
integer

Status code in the response greater than the specified value.

status__gte
integer

Status code in the response greater than or equal to the specified value.

status__lt
integer

Status code in the response less than the specified value.

status__lte
integer

Status code in the response less than or equal to the specified value.

status__eq
integer

Status code in the response equal to the specified value.

status__ne
integer

Status code in the response not equal to the specified value.

status__in
string

List of status codes in the response. Values should be separated by a comma.

status__not_in
string

List of status codes not in the response. Values should be separated by a comma.

size__gt
integer

Response size in bytes greater than the specified value.

size__gte
integer

Response size in bytes greater than or equal to the specified value.

size__lt
integer

Response size in bytes less than the specified value.

size__lte
integer

Response size in bytes less than or equal to the specified value.

size__eq
integer

Response size in bytes equal to the specified value.

size__ne
integer

Response size in bytes not equal to the specified value.

size__in
string

List of response sizes in bytes. Values should be separated by a comma.

size__not_in
string

List of response sizes in bytes not equal to the specified values. Values should be separated by

cname__eq
string

Custom domain of the requested CDN resource.

cname__ne
string

Custom domain of the requested CDN resource not equal to the specified value.

cname__in
string

List of custom domains of the requested CDN resource. Values should be separated by a comma.

cname__not_in
string

List of custom domains of the requested CDN resource not equal to the specified values. Values should be separated by a comma.

cname__contains
string

Part of the custom domain of the requested CDN resource. Minimum length is 3 characters.

resource_id__gt
integer

ID of the requested CDN resource greater than the specified value.

resource_id__gte
integer

ID of the requested CDN resource greater than or equal to the specified value.

resource_id__lt
integer

ID of the requested CDN resource less than the specified value.

resource_id__lte
integer

ID of the requested CDN resource less than or equal to the specified value.

resource_id__eq
integer

ID of the requested CDN resource equal to the specified value.

resource_id__ne
integer

ID of the requested CDN resource not equal to the specified value.

resource_id__in
string

List of IDs of the requested CDN resource. Values should be separated by a comma.

resource_id__not_in
string

List of IDs of the requested CDN resource not equal to the specified values. Values should be separated by a comma.

cache_status__eq
string

Caching status. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'.

cache_status__ne
string

Caching status not equal to the specified value. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'.

cache_status__in
string

List of caching statuses. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'. Values should be separated by a comma.

cache_status__not_in
string

List of caching statuses not equal to the specified values. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'. Values should be separated by a comma.

datacenter__eq
string

Data center where request was processed.

datacenter__ne
string

Data center where request was not processed.

datacenter__in
string

List of data centers where request was processed. Values should be separated by a comma.

datacenter__not_in
string

List of data centers where request was not processed. Values should be separated by a comma.

Response

200 - application/json

Successful.

data
object[]

Contains requested logs.

meta
object

Contains meta-information.