Log Files Report - GET /api/report/{domain-id}/log

Reports ››
Parent Previous Next

GET /api/report/{domain-id}/log        

Get the raw logs for a domain.  Domain-id is a unique ID representing a domain. It is returned when you create a domain.  Request parameters allow you to specify a time period.

This API returns URLs pointing to gzip compressed log files.  

Here is an example of a log entry:


9.8.7.6 - - [10/Dec/2018:02:00:47 +0000] "GET https://www.quantil.com" 200 9413 - "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"


The default log file format consists of the following fields:



A '-' in a field indicates missing data.  


Request Details


Request Headers


Header

Description

Required

Authorization

Authorization string for the request

Yes

Host

URI for the QUANTIL SDK (i.e., api.quantil.com)

Yes

Date

The date and time of the request.

Yes

Accept

Indicates the accepted format (i.e., application/xml)

Yes

Request Parameters

Parameter

Description

Required

datefrom

RFC3339 formatted date indicating the starting date. Example: 2013-01-01T22:30:00+08:00

Yes

dateto

RFC3339 formatted date indicating the ending date. Example: 2013-01-01T22:30:00+08:00.

Yes


Request Body Elements

This request does not include an XML document in the request body.


Request Syntax:


GET /api/report/{domain-id}/log HTTP/1.1

Authorization: <authorization string>

Host: api.quantil.com

Date: <date>

Accept: application/xml


Here is the structure of a request using the curl utility.


curl -i --url https://api.quantil.com/api/report/ {domain-ID} /log ?datefrom = {date from} & dateto = {date to}

-X GET

-u {user}: {password}

-H 'Date: Fri, 26 Oct 2012 06:33:26 GMT'

-H 'Accept: application/xml'

Sample Request:


curl -i --url 'https://api.quantil.com/api/report/3487/log?datefrom=2014-08-01T00:00:00%2B09:00&dateto=2014-08-05T23:59:59%2B09:00' -u test:IltUPtb1nMmbHUyNruhjFDBkPvs= -H 'Date: Fri, 08 Aug 2014 14:10:38 PDT' -H 'Accept: application/xml'

Response Details:


Response Headers:

HTTP/1.1 200 OK

Date: <date>

Content-Type: application/xml; charset = utf-8

x-cnc-request-id: {id string auto generated by the QUANTIL server}



Response Body Elements


Element

Description

logs

container of zero or more <log> elements.

log

a container object which describes a log file.  It contains one of each of these elements: <datefrom>, <dateto>,  <log-url>, and <file-size>.

datefrom

timestamp for the beginning of the period. This will be in the format YYYY-MM-DD-HH-MM representing a 4 digit year, digit month, 2 digit day, 2 digit hour and 2 digit minutes Example: 2014-08-25-0000 represents the beginning of the day, August 25, 2014.

dateto

timestamp for the end of the period.  This will be in the format YYYY-MM-DD-HH-MM representing a 4 digit year, digit month, 2 digit day, 2 digit hour and 2 digit minute. Note that a time of 23:30 actually includes the remaining half hour of the day to 11:59:59 PM.  Example:  2014-08-25-23-30 covers the end of the day of August 25, 2014.

log-url

full URL of the log file that you can download.  Logs are available for a period determined by the log-storage-day domain configuration option.

file-size

size of the log file in bytes

Sample Response:

HTTP/1.1 200 OK

Date: Fri, 08 Aug 2014 21:41:19 GMT

Accept-Ranges: bytes

Server: WS-web-server

x-cnc-request-id: 1148121

ContentType: application/xml;charset=UTF-8

Content-Type: application/xml;charset=UTF-8

Content-Length: 425


<?xml version="1.0" encoding="UTF-8"?><logs xmlns="http://www.w3.org/1999/xhtml"><log><datefrom>2014-08-03-0000</datefrom><dateto>2014-08-03-2330</dateto><log-url>http://dx.wslog.chinanetcenter.com/log/rockn_test02/140619.donotdelete.flowtest.test.com/2014-08-03-0000-2330_140619.donotdelete.flowtest.test.com.cn.log.gz?wskey=e269008b22789d3000dfbfb260db53004f74871335003c99</log-url><file-size>10502</file-size></log></logs>

Error List


Error

Description

HTTP status code

InvalidDatePeriod

The date specified is invalid.

400

NoSuchDomain

The specified domain does not exist.

404