New Relic

WARNING: This information is part of a limited availability release. Portions of this API may be subject to changes and improvements over time. Fields marked deprecated may be removed in the future and their use is discouraged. For more information, see our product and feature lifecycle descriptions.

Fastly will upload log messages to New Relic Logs in the format specified in the New Relic configuration object.

Data model

nameStringThe name of the New Relic Logs logging endpoint. Required.
service_idStringThe alphanumeric string identifying a service.
versionIntegerThe current version of a service.
formatStringApache style log formatting. Your log must produce valid JSON that New Relic Logs can ingest. Default is: {"time_elapsed":%{time.elapsed.usec}V, "is_tls":%{if(req.is_ssl, "true", "false")}V, "client_ip":"%{req.http.Fastly-Client-IP}V", "geo_city":"%{client.geo.city}V", "geo_country_code":"%{client.geo.country_code}V", "request":"%{req.request}V", "host":"%{req.http.Fastly-Orig-Host}V", "url":"%{json.escape(req.url)}V", "request_referer":"%{json.escape(req.http.Referer)}V", "request_user_agent":"%{json.escape(req.http.User-Agent)}V", "request_accept_language":"%{json.escape(req.http.Accept-Language)}V", "request_accept_charset":"%{json.escape(req.http.Accept-Charset)}V", "cache_status":"%{regsub(fastly_info.state, "^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*", "\\2\\3") }V"}.
format_versionIntegerThe version of the custom logging format used for the configured endpoint. Can be either 2 (the default, version 2 log format) or 1 (the version 1 log format). The logging call gets placed by default in vcl_log if format_version is set to 2 and in vcl_deliver if format_version is set to 1.
placementStringWhere in the generated VCL the logging call should be placed, overriding any format_version default. Can be none or waf_debug. This field is not required and has no default value.
created_atStringTime-stamp (GMT) when the endpoint was created.
updated_atStringTime-stamp (GMT) when the endpoint was updated.
deleted_atStringTime-stamp (GMT) when the endpoint was deleted.
response_conditionStringWhen to execute the New Relic Logs logging rule. If empty, always execute.
tokenStringThe Insert API key from the Account page of your New Relic account. Required.

Endpoints

List New Relic log endpoints

GET/service/service_id/version/version/logging/newrelic

Get a New Relic log endpoint

GET/service/service_id/version/version/logging/newrelic/name

Create a New Relic log endpoint

POST/service/service_id/version/version/logging/newrelic

Update a New Relic log endpoint

PUT/service/service_id/version/version/logging/newrelic/old_name

Delete a New Relic log endpoint

DELETE/service/service_id/version/version/logging/newrelic/name

User contributed notes

We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.