> For the complete documentation index, see [llms.txt](https://docs.getlimy.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getlimy.ai/limy-pixel/cdn-integration/fastly.md).

# Fastly

### Overview

This setup leverages Fastly’s custom HTTPS endpoint to send real-time log data directly to the Agent Monitor API.\
To learn more, see the official Fastly documentation.

{% stepper %}
{% step %}
Navigate to the Service configuration tab.

<figure><img src="/files/vYkwfXrMn7oClsF7STb1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Navigate to "Logging", find HTTPS and click "Create Endpoint"

<figure><img src="/files/RBEzs1PFCiJEWv8Be8QR" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Configure HTTPS Endpoint with the following info:

**Name: Limy Analytics**

**Placement:** Default

**URL:** `https://stream.getlimy.ai`

**Maximum logs & Maximum bytes:** Optional\
\
**Log format**: Paste the following log format. A different API might be rejected. Please contact us for any changes at `answers@limy.ai`

```json
{
    "timestamp": "%{strftime(\{"%Y-%m-%dT%H:%M:%S%z"\}, time.start)}V",
    "client_ip": "%{req.http.Fastly-Client-IP}V",
    "geo_country": "%{client.geo.country_name}V",
    "geo_city": "%{client.geo.city}V",
    "host": "%{if(req.http.Fastly-Orig-Host, req.http.Fastly-Orig-Host, req.http.Host)}V",
    "url": "%{json.escape(req.url)}V",
    "request_method": "%{json.escape(req.method)}V",
    "request_protocol": "%{json.escape(req.proto)}V",
    "request_referer": "%{json.escape(req.http.referer)}V",
    "request_user_agent": "%{json.escape(req.http.User-Agent)}V",
    "response_state": "%{json.escape(fastly_info.state)}V",
    "response_status": %{resp.status}V,
    "response_reason": %{if(resp.response, "%22"+json.escape(resp.response)+"%22", "null")}V,
    "response_body_size": %{resp.body_bytes_written}V,
    "fastly_server": "%{json.escape(server.identity)}V",
    "fastly_is_edge": %{if(fastly.ff.visits_this_service == 0, "true", "false")}V
  }
```

<figure><img src="/files/decHMgoi29bxlmFtMgAn" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Open " Advanced options" and configure as following:

* **Content type** - `application/json`
* **Custom header name** - `X-API-Key`
* **Custom header value** - Your API key `lmy_XXXXX`
* **Method** - `POST`
* **JSON log entry format** - `Array of JSON`
* **Select a log line format** - `Blank`

<figure><img src="/files/3YGU1TZaqOB2DAwAWbcB" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Need More Help?

* Contact `answers@limy.ai` for any further questions
