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

# Integrate Fastly with Conductor Intelligence

> Send log file data from Fastly to Conductor Intelligence's Pages report.

<Warning>
  Note that the instructions in this article describe the process for integrating with Conductor Intelligence. You can also integrate Fastly for Conductor Monitoring's [Log File Analysis](/docs/monitoring/setting-up-the-fastly-integration/) feature.
</Warning>

Integrating [Fastly Real-Time Log Streaming](https://docs.fastly.com/en/guides/about-fastlys-realtime-log-streaming-features) with Conductor Intelligence consists of two phases:

* Enabling log files and creating an [AWS S3 bucket](https://aws.amazon.com/s3/) in Conductor Intelligence.
* Configuring Fastly Real-Time Log Streaming in the Fastly UI.

## Enabling log files and creating an AWS S3 bucket in Conductor Intelligence

In Conductor Intelligence:

1. Go to the [Pages & Crawling](https://app.conductor.com/u/pages-and-crawling) settings activity (**Settings** > **Pages & Crawling**).
2. From the list of configured subdomains, identify the subdomain with the pages for which you want to see log file data.
3. In the **Log Source** column for that subdomain, click **Connect**.
4. In the Fastly section, from the **Connect a log source** window, click **Connect**.
5. Enter your **Fastly Customer ID**. You can find this in your **Fastly Control Panel** or with a `GET` request to Fastly's API `/current_customer` endpoint.
6. In the **Connect Fastly** window, click **Create Bucket**.
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/JYB26t33RXvVSQWE/images/intelligence/fastly-create-bucket.png?fit=max&auto=format&n=JYB26t33RXvVSQWE&q=85&s=addfa9ba671042a954f50c80cc9b3bd7" alt="Fastly Create Bucket" width="832" height="473" data-path="images/intelligence/fastly-create-bucket.png" />
   </Frame>
   Conductor Intelligence will generate the following AWS credentials and the AWS S3 bucket you will need below to associate the AWS S3 bucket with Fastly Real-Time Log Streaming in the next section:
   * **Bucket**
   * **Region**
   * **IAM role**
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/JYB26t33RXvVSQWE/images/intelligence/fastly-complete-integration.png?fit=max&auto=format&n=JYB26t33RXvVSQWE&q=85&s=86aeafcb8b4a21da04c5789f00116c4f" alt="Fastly Complete Integration" width="832" height="538" data-path="images/intelligence/fastly-complete-integration.png" />
   </Frame>
7. Click **Complete Integration**.

## Configuring Fastly Real-Time Log Streaming

Fastly Real-Time Log Streaming needs to be manually configured in the Fastly UI for every website.

The configuration of Fastly Real-Time Log Streaming consists of these steps:

1. Log in to your [Fastly account](https://manage.fastly.com/services/all) and click on the website (service) for which you want to send log file data to Conductor Intelligence.
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-service_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=629d98fa713e897d3748026de21f2035" alt="contentking-lfa-fastly-service@2x.png" width="1200" height="513" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-service_2x.png" />
   </Frame>

2. In the service summary screen, click **Edit configuration**.
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-edit-configuration_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=6078b95956a5ea52926000c7ad1ddccc" alt="contentking-lfa-fastly-edit-configuration@2x.png" width="1200" height="682" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-edit-configuration_2x.png" />
   </Frame>

3. In the left-hand navigation bar, click **Logging**, and then click **Create endpoint**.
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-logging_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=ba513709a1bd53439e88dc7a101eb050" alt="contentking-lfa-fastly-logging@2x.png" width="1200" height="745" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-logging_2x.png" />
   </Frame>

4. In the **Amazon S3** section click **Create endpoint**.
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-s3-endpoint_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=744978b309e71c9920df0820ff823105" alt="contentking-lfa-fastly-s3-endpoint@2x.png" width="1200" height="484" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-s3-endpoint_2x.png" />
   </Frame>

5. In the **S3 endpoint details** screen add the following settings:
   <Frame>
     **  <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-edit-s3-endpoint-p1_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=b62fd9b288e7e96eb15da050bdaa345d" alt="contentking-lfa-fastly-edit-s3-endpoint-p1@2x.png" width="1200" height="951" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-edit-s3-endpoint-p1_2x.png" />**
   </Frame>
   * **Name**: enter any name that would help easily identify the endpoint, e.g, "Conductor Intelligence S3"
   * **Placement**: Format Version Default (this is the default, no change needed)
   * **Log format**: Paste the following format
     ```
     {
       "timestampMs": %{time.start.msec}V,
       "ip": "%{req.http.Fastly-Client-IP}V",
       "url": "%{if(req.is_ssl, "https", "http")}V://%v%U%q",
       "method": "%{json.escape(req.method)}V",
       "userAgent": "%{json.escape(req.http.User-Agent)}V",
       "host": "%{if(req.http.Fastly-Orig-Host, req.http.Fastly-Orig-Host, req.http.Host)}V"
     }
     ```
   * **Timestamp format**: `%Y-%m-%dT%H:%M:%S.000` (this is the default one, no change needed)
   * **Bucket name**: enter the bucket name from the credentials you saved from Conductor Intelligence that was generated in the steps above.
   * **Access Method**: User Credentials
   * **Access key**: enter the Access key from the credentials in Conductor Intelligence generated in the steps above.
   * **Secret key**: enter the Secret key from the credentials in Conductor Intelligence generated in the steps above.
   * **Period**: 60 seconds.

6. Click **Advanced options** and edit more properties:
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-s3-endpoint-advanced-settings_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=4429fc665aee1d7e7722d406326c08f5" alt="contentking-lfa-fastly-s3-endpoint-advanced-settings@2x.png" width="1200" height="908" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-s3-endpoint-advanced-settings_2x.png" />
   </Frame>
   * **Path**: / (this is default, no need to change this)
   * **Domain**: enter the Domain from the credentials in Conductor Intelligence generated in the steps above.
   * **PGP public key**: keep this empty (this is default, no need to change this)
   * **Select a log line format**: Blank (this is default, no need to change this)
   * **Compression**: Gzip
   * The rest of the settings: keep the default ones

7. Click **Update**.

## Filter away non-search engine traffic

### Setting up the response condition

To configure a response condition, so only search engine traffic is sent to the S3 bucket, follow the steps below.

<Info>
  Although Conductor Intelligence filters out all non-search engine traffic, Conductor also requires setting up the condition to filter out all non-search engine traffic directly in your Fastly account so no other data is streamed to the S3 bucket.
</Info>

1. In the left-hand navigation bar, select **Conditions**:
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-conditions_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=091071ed8c98e2ea3e32e63855c668be" alt="contentking-lfa-fastly-conditions@2x.png" width="1200" height="850" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-conditions_2x.png" />
   </Frame>
2. In the **Condition** screen, click **Create condition**:
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-create-conditions_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=4192ce2d3b0f1915a7b35678fb6c93ce" alt="contentking-lfa-fastly-create-conditions@2x.png" width="1200" height="729" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-create-conditions_2x.png" />
   </Frame>
3. In the **Condition details** screen, fill in the following condition:
   * **Type**: Response
   * **Name**: any name, e.g. "Is Crawler"
   * **Apply if**... Paste the exact condition below:
     `req.http.user-agent ~ "bingbot" || req.http.user-agent ~ "Googlebot" || req.http.user-agent ~ "OAI-SearchBot" || req.http.user-agent ~ "ChatGPT-User" || req.http.user-agent ~ "GPTBot" || req.http.user-agent ~ "PerplexityBot" || req.http.user-agent ~ "Perplexity-User"`
   * **(Note:** These strings are case sensitive. Confirm you have the precise upper- and lower-case letters.**)**
4. Click **Save**.
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-condition-settings_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=3c0e2106766e1003c87d2caf2cb0285d" alt="contentking-lfa-fastly-condition-settings@2x.png" width="1200" height="1321" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-condition-settings_2x.png" />
   </Frame>

### Attaching the condition to the needed endpoint

To attach the condition to the created endpoint follow these steps:

1. Open the Logging endpoints screen by clicking on **Logging** in the left-hand navigation bar, and clicking **Attach condition** for the endpoint you've just created.
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-attach-condition_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=f4bc1381cb0efa0d07b480e5309a3f67" alt="contentking-lfa-fastly-attach-condition@2x.png" width="1200" height="705" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-attach-condition_2x.png" />
   </Frame>
2. In the **Add a condition** screen, select the condition you've just set up:
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-attach-condition-activation_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=696a524198480e6ec379434ef5239df9" alt="contentking-lfa-fastly-attach-condition-activation@2x.png" width="1200" height="693" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-attach-condition-activation_2x.png" />
   </Frame>
3. To save all changes, just click **Activate**.
   <Frame>
     <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-attach-condition-setting_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=605b42a011ecc21f52fcc1870c657c7e" alt="contentking-lfa-fastly-attach-condition-setting@2x.png" width="1200" height="543" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-attach-condition-setting_2x.png" />
   </Frame>

If everything has been configured correctly, you should see a success message.

<Frame>
  <img src="https://mintcdn.com/conductor-0f65a05d/8GiJK_LzAbaM_dYD/images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-attach-condition-success-message_2x.png?fit=max&auto=format&n=8GiJK_LzAbaM_dYD&q=85&s=48d2e9b6b7fe74022ccd0d0510ede670" alt="contentking-lfa-fastly-attach-condition-success-message@2x.png" width="1200" height="562" data-path="images/monitoring/setting-up-the-fastly-integration--contentking-lfa-fastly-attach-condition-success-message_2x.png" />
</Frame>

## Disabling Log File Data in Conductor Intelligence's Pages Reports

1. In **Pages & Crawling**, hover over the subdomain for which you want to remove Fastly and click **Edit** in the **Log Source** column.
2. In the bottom-right of the **Connect Fastly** form, click **Remove**.
3. Click **Remove Log Source** to confirm.

Conductor Intelligence cannot access your Fastly account, so you also need to remove the logging endpoint manually in the Fastly UI.
