circle-info
Version 2 is coming up

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.

1

Navigate to the Service configuration tab.

2

Navigate to "Logging", find HTTPS and click "Create Endpoint"

3

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 [email protected]

{
    "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
  }

4

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

Need More Help?

Last updated