Changing log line formats

Fastly's Real-Time Log Streaming feature allows you to change the format that your log messages are delivered in. By default, we send log messages out in standard syslog format. The prefix for this format (as defined in RFC 3164) appears as follows:

 <134>2016-07-04T22:37:26Z cache-sjc3128 LogTest[62959]: <your log message>

The prefix begins with the message priority (always <134>, which means Facility=Local0, Severity=Informational), followed the date and time the log was sent (2016-07-04T22:37:26Z), the cache node it came from (in this case cache-sjc3128), the name of your log (LogTest) and the ID of the process sending it (62959).

Available message formats

Although the default message prefix works for most logging services and processors, we allow you to choose one of several formats:

Updating endpoints to use a different format

The following logging endpoints can be updated to use a message format other than the default:

To update one of the above logging endpoints, run the following command:

curl -X PUT -H 'Fastly-Key: <your Fastly API key>' -H 'Content-Type: application/json' 'https://api.fastly.com/service/<your Fastly service ID>/version/<version number/logging/<log type>/<log name>' --data-binary '{"message_type":"<type>"}'

where log type is one of the eligible endpoint types:

Keep in mind that the message_type field is a per-object field. Updating it on one logging object will not change it on any other objects. For example, to update a Google Cloud Storage endpoint to the blank message type the cURL command would look something like this if the endpoint was named "GCS Test":

curl -X PUT -H 'Fastly-Key: d3cafb4dde4dbeef' -H 'Content-Type: application/json' 'https://api.fastly.com/service/SU1Z0isxPaozGVKXdv0eY/version/1/logging/gcs/GCS%20Test' --data-binary '{"message_type":"blank"}'

Back to Top