The table below lists all the built-in variables supported by the CDN360 servers. You can use them in Edge Logic or the real-time log. Please notice that not all variables are supported in both places.
If you use the CDN360 portal to edit the property, the autocompletion feature will list all the supported variables if you type $
at a position where a variable is allowed.
Variable Name | Description | Supported in Edge Logic | Supported in Real-Time Log |
---|---|---|---|
$arg_name | query parameter with the specified name | Yes | Yes |
$args | the full query string from client | Yes | Yes |
$bytes_received | bytes received from client | Yes | Yes |
$body_bytes_sent | body bytes sent to client | No | Yes |
$bytes_sent | total response bytes to client | No | Yes |
$cache_misc | parameters to add to the cache key | Yes | No |
$client_country_code | client’s ISO 3166 country code | Yes | Yes |
$client_http_version | client's HTTP version, like "HTTP/1.1" | Yes | Yes |
$client_ip_version | client's IP version 4: for IPv4 6: for IPv6 | Yes | Yes |
$client_isp | client's ISP information | Yes | Yes |
$client_province_code | client's China province code | Yes | Yes |
$client_real_ip | client's IP address | Yes | Yes |
$connection_requests | current number of requests in the connection | No | Yes |
$content_length | request's Content-Length header | Yes | Yes |
$content_type | request's Content-Type header | Yes | Yes |
$cookie_name | cookie with the specified name received from client | Yes | Yes |
$dollar_sign | a literal dollar sign | Yes | Yes |
$error_code | error about client and origin | No | Yes |
$host | host header, same as $http_host | Yes | Yes |
$hostname | server's hostname | Yes | Yes |
$http_name | request header with the specified name | Yes | Yes |
$http_host | request's Host header | Yes | Yes |
$invalid_referer | empty string if the “Referer” request header field value is considered valid; otherwise “1” | Yes | Yes |
$is_args | empty or ?, when query string exists | Yes | Yes |
$msec | current time in seconds with milliseconds resolution | Yes | Yes |
$sec | current unix time in integer seconds | Yes | Yes |
$origin_host | origin's hostname | Yes | Yes |
$origin_ip | origin's IP | Yes | Yes |
$origin_status_code | origin's status code | Yes | Yes |
$pid | process ID of the service | Yes | Yes |
$pipe | 'p' if request is pipelined, or '.' otherwise. | No | Yes |
$qtl_req_id | a unique ID for the request | Yes | Yes |
$qtl_upstream_cache_status | edge cache HIT, MISS, etc. | Yes | Yes |
$realtime_log_ds_factor | RT log downsample factor. A value N means one log entry for every N requests | No | Yes |
$realtime_log_ds_ratio | RT log downsample ratio. The value should be 1/N, as decimal number between 0 and 1. (ETA: April 2021) | No | Yes |
$remote_user | user name supplied with Basic authentication | Yes | Yes |
$request | full HTTP request line | Yes | Yes |
$request_length | length of request line, header and body | Yes | Yes |
$request_method | HTTP method: GET, POST, etc. | Yes | Yes |
$request_scheme | http or https | Yes | Yes |
$request_time | request processing time in seconds with milliseconds resolution; time elapsed since the first bytes were read from the client | Yes | Yes |
$request_uri | request URI with query string received from client | Yes | Yes |
$sc_completed | 1: if last byte was served 0: if last byte was not served | No | Yes |
$sc_initial | 1: if first byte was served 0: if first byte was not served | No | Yes |
$sent_http_name | header with the specified name sent to client | No | Yes |
$sent_http_content_length | Content-Length to client | No | Yes |
$served_from_cache | 1: HIT on edge 0: MISS on edge | Yes | Yes |
$server_addr | IP address of the edge server | No | Yes |
$server_protocol | HTTP/1.1 or HTTP/2.0 | No | Yes |
$service_port | port number that received the request | Yes | Yes |
$sorted_querystring_args | variable providing an ASCII-based sorted list of input query parameters; it can be modified by directive 'sorted_querystring_filter_parameter' | Yes | Yes |
$ssl_cipher | TLS cipher suite used | No | Yes |
$ssl_protocol | returns protocol name like "TLSv1.1" | No | Yes |
$ssl_server_name | TLS SNI servername | No | Yes |
$status | HTTP status code to client | Yes | Yes |
$tcpinfo_delivery_rate | TCP connection performance metrics, in bytes/s, to report the rate at which the sent data is acknowledged | No | Yes |
$tcpinfo_min_rtt | minimal RTT observed by TCP stack for the flow in microseconds | No | Yes |
$tcpinfo_rtt | RTT in microseconds | No | Yes |
$time_http | current time in RFC7231 format that can be used for HTTP Date header (ETA: April 2021) | Yes | Yes |
$upstream_bytes_received | number of bytes received from an upstream server | Yes | Yes |
$upstream_bytes_sent | number of bytes sent to an upstream server | Yes | Yes |
$upstream_connect_time | time spent in seconds with millisecond resolution establishing a connection with the upstream server | Yes | Yes |
$upstream_cookie_name | cookie with the specified name sent by the upstream server in the “Set-Cookie” response header field | Yes | Yes |
$upstream_header_time | time spent in seconds with millisecond resolution receiving the response header from the upstream server | Yes | Yes |
$upstream_http_name | header with the specified name received from origin | Yes | Yes |
$upstream_response_length | response length | Yes | Yes |
$upstream_response_time | time spent in seconds with millisecond resolution receiving the complete response from the upstream server | Yes | Yes |
$upstream_status | status code from upstream | Yes | Yes |
$uri | request $uri without query string. In Edge Logic, it may be modified by the rewrite directive | Yes | Yes |