> ## Documentation Index
> Fetch the complete documentation index at: https://promptwatch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fastly

> Configure crawler log ingestion via Fastly HTTPS logging

<div style={{ display: "flex", alignItems: "center", justifyContent: "center", marginBottom: 0 }}>
  <img alt="Fastly" height="40" src="https://www.promptwatch.com/docs/integration-logos/card/fastly.jpg" width="40" />
</div>

<p style={{ textAlign: "center", color: "#6b7280", marginTop: 8, marginBottom: 24 }}>
  Stream logs from Fastly CDN
</p>

## Step 1: Create an API Key

Create an API key in Promptwatch. Go to **Settings → API Keys** in your [Promptwatch dashboard](https://app.promptwatch.com).

## Step 2: Create HTTPS Logging Endpoint

Create an HTTPS logging endpoint following [these instructions](https://www.fastly.com/documentation/guides/integrations/logging-endpoints/log-streaming-https/#adding-https-as-a-logging-endpoint). Use these settings:

**URL:**

```
https://logs.promptwatch.com/event/fastly
```

**Logging format:**

```json theme={null}
{
  "timestamp": "%{strftime({\"%Y-%m-%dT%H:%M:%S%z\"}, time.start)}V",
  "host": "%{if(req.http.Fastly-Orig-Host, req.http.Fastly-Orig-Host, req.http.Host)}V",
  "status_code": %{resp.status}V,
  "request_method": "%{json.escape(req.method)}V",
  "request_path": "%{json.escape(req.path)}V",
  "query_string": "%{json.escape(req.url.qs)}V",
  "content_type": "%{json.escape(resp.http.Content-Type)}V",
  "client_ip": "%{req.http.Fastly-Client-IP}V",
  "user_agent": "%{json.escape(req.http.User-Agent)}V",
  "referrer": "%{json.escape(req.http.referer)}V"
}
```

**Advanced settings:**

* **Content Type**: `application/json`
* **Custom header name**: `X-API-Key`
* **Custom header value**: `YOUR_API_KEY`
* **Method**: POST
* **JSON log entry format**: Array of JSON

The rest of the settings should keep their default values.

## Step 3: Finish

Create and activate your configuration to start sending logs to Promptwatch. Logs should be visible in a few minutes.

<Note>
  For a full list of API response codes, see [API Response Codes](/docs/crawler-logs/api-responses).
</Note>
