# Fastly

> Send logs to Last9 from Fastly for CDN monitoring

Source: https://last9.io/docs/integrations/web-and-cdn/fastly/

This document lists step-by-step instructions for pushing logs from Fastly CDN to Last9.

## Prerequisites

1. Create a Last9 cluster by following [Getting Started](/docs/onboard/).
2. Keep the following information handy after creating the cluster from the [Integrations](https://app.last9.io/integrations?integration=OpenTelemetry) page:
   - `$last9_otlp_endpoint`: Last9's OTLP endpoint copies from Fastly Integration section from [Integrations](https://app.last9.io/integrations) page.
   - `$last9_basic_auth_header`: OTLP Basic authorization header

## Setup

Last9 leverages Fastly's [real time log streaming](https://docs.fastly.com/en/guides/about-fastlys-realtime-log-streaming-features) Custom HTTPS endpoint integration to push logs from Fastly to Last9. Add Last9 ingestion endpoint for Fastly logs as Custom HTTPS endpoint by following next steps.

1. Select the Service for which you want to send logs to Last9 and click on **Logging**.

![Select the Fastly Service](../../../../../../assets/content/docs/integrations/web-and-cdn/cdn/fastly/fastly-logs-enable-https-endpoint.png)

2. Select HTTPS Endpoint.

![Click on the HTTPS endpoint](../../../../../../assets/content/docs/integrations/web-and-cdn/cdn/fastly/fastly-logs-https-endpoint.png)

3. Add the Last9 endpoint in the **URL** field. Use the `$last9_otlp_endpoint` copied in the earlier step.

Ensure that you add following query parameters. These are mandatory parameters for the Last9 integration.

```bash
?source=fastly&service_id=<fastly-service-id>
```

:::tip
You can also add any other additional query parameters to the URL. Make sure to URL encode the query parameters.
:::

![Fastly Last9 ingestion endpoint](../../../../../../assets/content/docs/integrations/web-and-cdn/cdn/fastly/fastly-logs-https-endpoint-details-1.png)

4. Add Authorization header under Advanced Configuration. Use the `$last9_basic_auth_header` copied in the earlier step.

![Fastly Last9 ingestion advanced configuration](../../../../../../assets/content/docs/integrations/web-and-cdn/cdn/fastly/fastly-logs-advanced-config.png)

Click `Create` to finish setting up Last9 logs ingestion endpoint.

## Verification

Visit [Log Explorer](https://app.last9.io/logs) to see the Fastly logs in action. The service name for all Fastly logs is `fastly` unless overriden in [Last9 Control Plane](https://last9.io/control-plane/).

---

## Troubleshooting

Please get in touch with us on [Discord](https://discord.com/invite/Q3p2EEucx9)
or [Email](mailto:support@last9.io) if you have any questions.
