Skip to content

CDNetworks 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. 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 NameDescriptionSupported in Edge LogicSupported in Real-Time Log
$arg_namequery parameter with the specified nameYesYes
$argsthe full query string from clientYesYes
$bytes_receivedbytes received from clientYesYes
$body_bytes_sentbody bytes sent to clientNoYes
$bytes_senttotal 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_versionclient's IP version
4: for IPv4
6: for IPv6
YesYes
$client_ispclient's ISP informationYesYes
$client_province_codeclient's China province codeYesYes
$client_real_ipclient's IP addressYesYes
$connection_requestscurrent number of requests in the connectionNoYes
$content_lengthrequest'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
$mseccurrent time in seconds with milliseconds resolutionYesYes
$seccurrent 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_statusedge cache HIT, MISS, etc.YesYes
$realtime_log_ds_factorRT log downsample factor. A value N means one log entry for every N requestsNoYes
$realtime_log_ds_ratioRT log downsample ratio. The value should be 1/N, as decimal number between 0 and 1. (ETA: April 2021)NoYes
$remote_useruser name supplied with Basic authenticationYesYes
$requestfull HTTP request lineYesYes
$request_lengthlength of request line, header and bodyYesYes
$request_methodHTTP method: GET, POST, etc.YesYes
$request_schemehttp or httpsYesYes
$request_timerequest processing time in seconds with milliseconds resolution;
time elapsed since the first bytes were read from the client
YesYes
$request_urirequest URI with query string received from clientYesYes
$sc_completed1: if last byte was served
0: if last byte was not served
NoYes
$sc_initial1: if first byte was served
0: if first byte was not served
NoYes
$sent_http_nameheader with the specified name sent to clientNoYes
$sent_http_content_lengthContent-Length to clientNoYes
$served_from_cache1: HIT on edge
0: MISS on edge
YesYes
$server_addrIP address of the edge serverNoYes
$server_protocolHTTP/1.1 or HTTP/2.0NoYes
$service_portport number that received the requestYesYes
$sorted_querystring_argsvariable providing an ASCII-based sorted list of input query parameters;
it can be modified by directive 'sorted_querystring_filter_parameter'
YesYes
$ssl_cipherTLS cipher suite usedNoYes
$ssl_protocolreturns protocol name like "TLSv1.1"NoYes
$ssl_server_nameTLS SNI servernameNoYes
$statusHTTP status code to clientYesYes
$tcpinfo_delivery_rateTCP connection performance metrics, in bytes/s, to report the rate at which the sent data is acknowledgedNoYes
$tcpinfo_min_rttminimal RTT observed by TCP stack for the flow in microsecondsNoYes
$tcpinfo_rttRTT in microsecondsNoYes
$time_httpcurrent time in RFC7231 format that can be used for HTTP Date header (ETA: April 2021)YesYes
$upstream_bytes_receivednumber of bytes received from an upstream serverYesYes
$upstream_bytes_sentnumber of bytes sent to an upstream serverYesYes
$upstream_connect_timetime spent in seconds with millisecond resolution establishing a connection with the upstream serverYesYes
$upstream_cookie_namecookie with the specified name sent by the upstream server in the “Set-Cookie” response header fieldYesYes
$upstream_header_timetime spent in seconds with millisecond resolution receiving the response header from the upstream serverYesYes
$upstream_http_nameheader with the specified name received from originYesYes
$upstream_response_lengthresponse lengthYesYes
$upstream_response_timetime spent in seconds with millisecond resolution receiving the complete response from the upstream serverYesYes
$upstream_statusstatus code from upstreamYesYes
$urirequest $uri without query string. In Edge Logic, it may be modified by the rewrite directiveYesYes