v32

latestOpenAPI 3.1.0raw.githubusercontent.com2026-05-151,1412,2144.5 MB
Logs uploader

Create policy

Create logs uploader policy.

post/cdn/logs_uploader/policies

Request body

include_empty_logsboolean

Include empty logs in the upload.

include_shield_logsboolean

Include logs from origin shielding in the upload.

namestring

Name of the policy.

descriptionstring

Description of the policy.

retry_interval_minutesinteger

Interval in minutes to retry failed uploads.

rotate_interval_minutesinteger

Interval in minutes to rotate logs.

rotate_threshold_mbinteger nullable

Threshold in MB to rotate logs.

rotate_threshold_linesinteger

Threshold in lines to rotate logs.

date_formatstring

Date format for logs.

field_delimiterstring

Field delimiter for logs.

field_separatorstring

Field separator for logs.

fieldsstring[]

List of fields to include in logs.

file_name_templatestring

Template for log file name.

format_type'json' | ''

Format type for logs.

Possible values:

  • "" - empty, it means it will apply the format configurations from the policy.
  • "json" - output the logs as json lines.
tagsobject

Tags allow for dynamic decoration of logs by adding predefined fields to the log format. These tags serve as customizable key-value pairs that can be included in log entries to enhance context and readability.

escape_special_charactersboolean

When set to true, the service sanitizes string values by escaping characters that may be unsafe for transport, logging, or downstream processing.

The following categories of characters are escaped:

  • Control and non-printable characters
  • Quotation marks and escape characters
  • Characters outside the standard ASCII range

The resulting output contains only printable ASCII characters.

log_sample_ratenumber float

Sampling rate for logs. A value between 0 and 1 that determines the fraction of log entries to collect.

  • 1 - collect all logs (default).
  • 0.5 - collect approximately 50% of logs.
  • 0 - collect no logs (effectively disables logging without removing the policy).

Example request

{
  "include_empty_logs": true,
  "include_shield_logs": true,
  "name": "Policy",
  "description": "New policy",
  "retry_interval_minutes": 32,
  "rotate_interval_minutes": 32,
  "rotate_threshold_mb": 252,
  "rotate_threshold_lines": 5000,
  "date_format": "[02/Jan/2006:15:04:05 -0700]",
  "field_delimiter": ",",
  "field_separator": ";",
  "fields": [
    "remote_addr",
    "status"
  ],
  "file_name_template": "{{YYYY}}_{{MM}}_{{DD}}_{{HH}}_{{mm}}_{{ss}}_access.log.gz",
  "format_type": "json",
  "tags": {},
  "log_sample_rate": 1,
  "related_uploader_configs": [
    123
  ]
}

Response

Successful.

idinteger
client_idinteger

Client that owns the policy.

createdstring date-time

Time when logs uploader policy was created.

updatedstring date-time

Time when logs uploader policy was updated.

include_empty_logsboolean

Include empty logs in the upload.

include_shield_logsboolean

Include logs from origin shielding in the upload.

namestring

Name of the policy.

descriptionstring

Description of the policy.

retry_interval_minutesinteger

Interval in minutes to retry failed uploads.

rotate_interval_minutesinteger

Interval in minutes to rotate logs.

rotate_threshold_mbinteger nullable

Threshold in MB to rotate logs.

rotate_threshold_linesinteger

Threshold in lines to rotate logs.

date_formatstring

Date format for logs.

field_delimiterstring

Field delimiter for logs.

field_separatorstring

Field separator for logs.

fieldsstring[]

List of fields to include in logs.

file_name_templatestring

Template for log file name.

format_type'json' | ''

Format type for logs.

Possible values:

  • "" - empty, it means it will apply the format configurations from the policy.
  • "json" - output the logs as json lines.
tagsobject

Tags allow for dynamic decoration of logs by adding predefined fields to the log format. These tags serve as customizable key-value pairs that can be included in log entries to enhance context and readability.

escape_special_charactersboolean

When set to true, the service sanitizes string values by escaping characters that may be unsafe for transport, logging, or downstream processing.

The following categories of characters are escaped:

  • Control and non-printable characters
  • Quotation marks and escape characters
  • Characters outside the standard ASCII range

The resulting output contains only printable ASCII characters.

log_sample_ratenumber float

Sampling rate for logs. A value between 0 and 1 that determines the fraction of log entries to collect.

  • 1 - collect all logs (default).
  • 0.5 - collect approximately 50% of logs.
  • 0 - collect no logs (effectively disables logging without removing the policy).
related_uploader_configsinteger[]

List of logs uploader configs that use this policy.

Example response

{
  "id": 123,
  "client_id": 123,
  "created": "2023-11-07T05:31:56Z",
  "updated": "2023-11-07T05:31:56Z",
  "include_empty_logs": true,
  "include_shield_logs": true,
  "name": "Policy",
  "description": "New policy",
  "retry_interval_minutes": 32,
  "rotate_interval_minutes": 32,
  "rotate_threshold_mb": 252,
  "rotate_threshold_lines": 5000,
  "date_format": "[02/Jan/2006:15:04:05 -0700]",
  "field_delimiter": ",",
  "field_separator": ";",
  "fields": [
    "remote_addr",
    "status"
  ],
  "file_name_template": "{{YYYY}}_{{MM}}_{{DD}}_{{HH}}_{{mm}}_{{ss}}_access.log.gz",
  "format_type": "json",
  "tags": {},
  "log_sample_rate": 1,
  "related_uploader_configs": [
    123
  ]
}