Skip to content

Quantil Documentation

Built-in Variables permalink

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. The variables with numerical values are tagged with #. 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 NameDescriptionEdge LogicR-T Log
$arg_namequery parameter with the specified nameYesYes
$argsthe full query string from clientYesYes
$bytes_received# bytes received from clientYesYes
$body_bytes_sent# body bytes sent to clientNoYes
$bytes_sent# total response bytes to clientNoYes
$cache_miscparameters to add to the cache keyYesNo
$client_country_codeclient’s ISO 3166 country codeYesYes
$client_http_versionclient's HTTP version, like "HTTP/1.1"YesYes
$client_ip_version# client's IP version: 4 for IPv4; 6 for IPv6YesYes
$client_ispclient's ISP informationYesYes
$client_province_codeclient's China province codeYesYes
$client_real_ipclient's IP addressYesYes
$connection_requests# current number of requests in the connectionNoYes
$content_length# request's Content-Length headerYesYes
$content_typerequest's Content-Type headerYesYes
$cookie_namecookie with the specified name received from clientYesYes
$dollar_signa literal dollar signYesYes
$error_codeerror about client and originNoYes
$hosthost header, same as $http_hostYesYes
$hostnameserver's hostnameYesYes
$http_namerequest header with the specified nameYesYes
$http_hostrequest's Host headerYesYes
$invalid_refererempty string if the “Referer” request header field value is considered valid; otherwise “1”YesYes
$is_argsempty or "?", when query string existsYesYes
$msec# current time in seconds with milliseconds resolutionYesYes
$sec# current unix time in integer secondsYesYes
$origin_hostorigin's hostnameYesYes
$origin_iporigin's IPYesYes
$origin_status_codeorigin's status codeYesYes
$pidprocess ID of the serviceYesYes
$pipe"p" if request is pipelined, or "." otherwise.NoYes
$qtl_req_ida unique ID for the requestYesYes
$qtl_upstream_cache_statuscache status: HIT, MISS, BYPASS, EXPIRED, STALE, UPDATING, REVALIDATED.YesYes
$realtime_log_ds_factor# RT log downsample factor. A value N means one log entry for every N requestsNoYes
$realtime_log_ds_ratio# RT log downsample ratio. The value should be 1/N, as a decimal number between 0 and 1. (ETA: May 2021)NoYes
$remote_useruser name supplied with Basic authenticationYesYes
$requestfull HTTP request lineYesYes
$request_cpu_time# CPU time, in nanoseconds, spent on processing the request by the CS stage (when used in the Edge Logic), or by the LB stage (when used in the real-time log) (ETA: July 2021)YesYes
$request_length# length of request line, header and bodyYesYes
$request_methodHTTP method: GET, POST, etc.YesYes
$request_scheme"http" or "https"YesYes
$request_time# request processing time in seconds with milliseconds resolution; time elapsed since the first byte was read from the clientYesYes
$request_urirequest URI with query string received from clientYesYes
$sc_completed# Value is 1 if the last byte was served to the client; 0 otherwise.NoYes
$sc_initial# Value is 1 if the first byte was served to the client; 0 otherwise.NoYes
$sent_http_nameheader with the specified name sent to clientNoYes
$sent_http_content_length# Content-Length to clientNoYes
$served_from_cache# Value is 1 for a HIT on edge; 0 for a MISS.YesYes
$server_addrIP address of the edge serverNoYes
$server_protocolHTTP/1.1 or HTTP/2.0NoYes
$service_port# port number that received the requestYesYes
$sorted_querystring_argsvariable providing an ASCII-based sorted list of input query parameters; it can be modified by the "sorted_querystring_filter_parameter" directiveYesYes
$ssl_cipherTLS cipher suite usedNoYes
$ssl_cpu_time# CPU time, in nanoseconds, spent on TLS handshake (ETA: July 2021)NoYes
$ssl_protocolreturns protocol name like "TLSv1.1"NoYes
$ssl_server_nameTLS SNI servernameNoYes
$statusHTTP status code to clientYesYes
$tcpinfo_delivery_rate# the rate, in bytes/s, at which the sent data is acknowledged by the client.NoYes
$tcpinfo_min_rtt# minimum RTT, in microseconds, observed by TCP stack for the connectionNoYes
$tcpinfo_rtt# latest RTT, in microseconds, observed by TCP stack for the connectionNoYes
$time_httpcurrent time in RFC7231 format that can be used for HTTP Date header (ETA: May 2021)YesYes
$upstream_bytes_received# number of bytes received from a parent or origin serverYesNo
$upstream_bytes_sent# number of bytes sent to a parent or origin serverYesNo
$upstream_connect_time# time spent in seconds with millisecond resolution establishing a connection with a parent or origin serverYesNo
$upstream_cookie_namecookie with the specified name received from the upstream server in the “Set-Cookie” response header field. May be served from the cache.YesYes
$upstream_header_time# time spent in seconds with millisecond resolution receiving the response header from a parent or origin serverYesNo
$upstream_http_nameheader with the specified name received from the upstream server. May be served from the cache.YesYes
$upstream_response_time# time spent in seconds with millisecond resolution receiving the complete response from a parent or origin serverYesNo
$upstream_server_type'O' for origin server; 'C' for parent cache server.YesNo
$upstream_statusstatus code from a parent or origin serverYesNo
$upstream_trailer_nametrailer with the specified name passed from the edge logic with the add_trailer directive.NoYes
$urirequest $uri without query string. In Edge Logic, it may be modified by the "rewrite" directiveYesYes