LOG IN SIGN UP
Documentation

Log streaming: Scalyr

Fastly's Real-Time Log Streaming feature can send log files to Scalyr. Scalyr pulls all your server logs and metrics into a centralized, searchable system in real-time.

Prerequisites

If you don't already have a Scalyr account, you'll need to register for one. Follow the signup instructions on the Scalyr website.

Once you've signed up, navigate to the API Keys area in the Settings on your Scalyr dashboard and make note of your Scalyr Write Token. Scaylr uses this to associate data you send them with your account. You'll need this token when you set up your endpoint with Fastly.

If you're adding the Scalyr endpoint via the command line, instead of the web interface, you should also have your Fastly API key and the service ID and version number of the Fastly service for which you'll be enabling Scalyr logging.

Adding Scalyr as a logging endpoint via the web interface

Follow these instructions to add Scalyr as a logging endpoint:

  1. Review the information in our Setting Up Remote Log Streaming guide.
  2. Click the Scalyr logo. The Create a new Scalyr endpoint page appears.

    New Scalyr Endpoint window

  3. Fill out the Create a new Scalyr endpoint fields as follows:

    • In the Description field, type a human-readable name for the endpoint.
    • In the Log format field, optionally type an Apache-style string or VCL variables to use for log formatting. The Apache Common Log format string appears in this field by default. See our guidance on format strings for more information.
    • In the Token field, type the Scalyr Write Token provided in the Scalyr dashboard.
  4. Click the Create button to create the new logging endpoint.

  5. Click the Activate button to deploy your configuration changes.

Adding Scalyr as a logging endpoint via command line

Run the following cURL command:

```plaintext
curl -s -X POST -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/scalyr' --data-binary '{"name":"<log name>", "format":"%h %l %u %t %r %>s","token":"<your Scalyr token>"}'
```

Be sure to replace <your Fastly API key>, <your Fastly service ID>, <version number>, <log name>, and <your Scalyr token> the appropriate details specific to your account.


Additional resources:


Back to Top