Prerequisites. An AWS account with a CloudFront distribution, and a
verified domain in Rankly. Your ingest token is in
Settings and is baked into the script Rankly generates.
Setup
Create the Firehose stream
Open AWS CloudShell and paste
the block Rankly generates for you. It creates an IAM role, an S3 bucket for
failed-delivery backups, and a Firehose stream pointed at Rankly. It is
idempotent, so rerunning is safe.Run the whole block. When it finishes it prints the stream name.
rankly-cloudfront-setup.sh
Attach the stream to CloudFront
In the CloudFront console, open your distribution and go to the Logging
tab. Turn standard logging on and configure:
Select these fields:
| Setting | Value |
|---|---|
| Log destination | Amazon Data Firehose |
| Delivery stream | the rankly-aa-...-firehose stream you just created |
| Output format | JSON |
date, time, c-ip, cs-method, x-host-header,
cs-uri-stem, cs-uri-query, cs(User-Agent), cs(Referer), sc-status,
sc-bytes, x-edge-request-id.CloudFront delivers logs in small batches, so there is a short delay (usually
under a minute) between a request and the event appearing. This is normal for
log-based integrations.