Fastly
Real-time data integration from Fastly to Netacea using S3 streaming
Last updated
Real-time data integration from Fastly to Netacea using S3 streaming
Last updated
To send real-time access logs from Fastly to an Amazon S3 bucket, you can configure Fastly log streaming using Amazon S3 as the destination. Below are the documented steps required to set up real-time streaming to a Netacea-hosted S3 bucket, using Fastly’s logging functionality and a custom log format that meets Netacea’s requirements.
To successfully stream web traffic logs to Netacea, please ensure the following:
You have an active Fastly account with access to the Fastly Control Panel.
A Fastly service is available and configured to handle your production traffic.
You have received the necessary AWS S3 bucket details (bucket name, region, path, and credentials) from Netacea. These can be found here.
You are aware of the minimum required dataset fields needed by Netacea for log analysis.
This option logs every request and delivers logs in batches. This is configurable to suit the requirements of the POV.
Log in to the Fastly control panel.
From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
Click Edit configuration and then select the option to clone the active version.
All configuration changes below will be made to the newly cloned version.
Navigate to the Logging area.
Click the 'Create endpoint' button for Amazon S3
Enter the details from the table below:
Name
Enter a memorable human-readable name for the endpoint, such as Netacea_Logging
Placement
Format Version Default
Log Format
Timestamp
Bucket Name
Domain
s3.eu-west-1.amazonaws.com
Access Method
Select 'User Credentials'
Access Key
Secret Key
Period
15
Expand the 'Advanced options' section and apply the specific values listed in the table below:
Path
/
PGP Public Key
Blank
Select Log line Format
Blank
Compression
Gzip
Redundancy Level
Standard
ACL
None
Server Side Encryption
None
Maximum Bytes
0
Click 'Create' to save the logging endpoint.
The above log format will allow Netacea to collect the following minimum dataset for analysis
Timestamp
The time at which the request was received
IP Address
The IP address from which the request was made
User Agent
The user agent string sent in the header by the client
Method
The HTTP method of the request
Path
The path of the requested resource
Query
The query string of the request
Status
The HTTP status code returned by the server
Referrer
The web page the user followed a link from
Bytes Sent
The Bytes sent as part of the servers response
Client JA3
Clients JA3 fingerprint
X-Forwarded-For*
Original IP address of a client request
Host
The destination host of the request
Protocol
The protocol of the request
Request Time
The complete amount of time it took to process the request
* Useful for when proxies are in the line of traffic from client > origin
When configuring Fastly log shipping, by default it will send all requests, including static & media content to the S3 bucket. This data is not required by Netacea. In order to solve this, we need to add a logging condition to the service and attach it to the logging service that has been created following the steps above.
Navigate to the newly created logging endpoint:
Click 'Create a new response condition'
Enter the following details into the popup window
Name
e.g. Netacea_Log_Visit
Apply If
(req.url !~ "/media/" && req.url !~ "/static/") && fastly.ff.visits_this_service == 0
Priority
10
Expand the 'Advanced option' section to set the Priority
Click 'Save and apply'
Check the configuration for any error messages or warnings.
Once confirmed, deploy your changes by clicking Activate.
Your Fastly log streaming configuration is now live and should be sending data to the Netacea S3 bucket.
Once log delivery is active, notify your Netacea Solutions Engineer. This allows us to:
Confirm receipt of data
Validate the dataset format and completeness
Begin analysis once a sufficient volume of data has been collected
If you require support during setup, the Netacea SE team is here to help — don’t hesitate to reach out.
Paste the Log Format found
Paste the Timestamp Format found
The name of the Amazon S3 bucket provided by Netacea within the
Copy from the Netacea
Copy from the Netacea