Overview

The integration uses Fastly’s custom HTTPS endpoint to forward Fastly real-time logs to our Agent Analytics API. Fastly’s real-time log streaming offers instant visibility into traffic, performance, threats, and troubleshooting, and streams logs to various destinations including HTTP endpoints. For more information about Fastly real-time logs, visit the Fastly documentation.

Prerequisites

  • A Fastly account
  • Access/permission to edit Logging Endpoints
  • API credentials for the Profound Agent Analytics platform

Configuration

1

Step 1

Sign into the Fastly console, select your service, and navigate to the Service configuration tab.Service Configuration Tab
2

Step 2

Select “Edit configuration” and navigate to the Logging section.Find “HTTPS” and click + Create endpointLogging Endpoint
3

Step 3

Configure your HTTPS endpoint with the following settings:Configuration
  • Name: Add an informative name
  • Placement: Use the default
  • URL: Enter https://artemis.api.tryprofound.com/v1/logs/fastly
  • Maximum logs & Maximum bytes: Optional, configure as needed.
  • Log format: Paste the following log format. This governs what information will be sent to the Agent Analytics API. If you use a different format, your logs may be rejected by the API.
      {
          "timestamp": "%{strftime(\{"%Y-%m-%dT%H:%M:%S%z"\}, time.start)}V",
          "client_ip": "%{req.http.Fastly-Client-IP}V",
          "start_time": "%{begin:%Y-%m-%dT%H:%M:%S%z}t",
          "end_time": "%{end:%Y-%m-%dT%H:%M:%S%z}t",
          "host": "%{req.http.Host}V",
          "url": "%{json.escape(req.url)}V",
          "request_method": "%{json.escape(req.method)}V",
          "request_referer": "%{json.escape(req.http.referer)}V",
          "request_user_agent": "%{json.escape(req.http.User-Agent)}V",
          "response_status": %{resp.status}V,
          "response_body_size": %{resp.body_bytes_written}V
      }
    
    • Time and IP
      • timestamp - Time when the request was completed
      • client_ip - Client IP address
    • Request Details
      • request_method - HTTP request method
      • host - Requested host header
      • url - Request url path
      • request_referer - Request referrer
      • request_user_agent - Client user agent
    • Response Details
      • start_time - The time at which the request began
      • end_time - The time at which the request finished
      • response_status - HTTP response status
      • response_body_size - Response size in bytes
    For more information see the documentation
    You may see a warning like:Warning MessageYou can safely ignore this message. The validation has been configured for you.
4

Step 4

Next, click “Attach a condition”Attach a condition 1Attach a condition 2Enter the following using your domain name:req.http.host == "my-website.com"Filter to hostThis filter will ensure that only logs for your selected domain are sent to Profound. Select Save and apply.
5

Step 5

Scroll down to “Advanced options”Advanced OptionsConfigure:
  • Content type - application/json
  • Custom header name - X-API-Key
  • Custom header value - Your provisioned API key for Profound’s Agent Analytics Platform (bot_xxxx-xxxx-...)
  • Method - POST
  • JSON log entry format - Array of JSON
  • Select a log line format - Blank
6

Finished

Save your configuration and activate the new service version.
That’s it! Fastly will now send real-time logs to Profound. Data should begin appearing in your dashboard within a few minutes.

Troubleshooting

  • If logs aren’t appearing, verify your HTTPS endpoint configuration
  • Check fastly for delivery errors
  • Verify your API credentials are correct
  • Verify your API endpoint is correct

Additional Resources