Log streaming: Bronto
Fastly's Real-Time Log Streaming feature can be configured to send logs in a format readable by Bronto. Bronto is a SaaS-based log management and log analytics solution designed for scalability, cost-efficiency, and advanced search capabilities.
Fastly does not provide direct support for third-party services. Read Fastly's Terms of Service for more information.
Prerequisites
Before adding Bronto as a logging endpoint for Fastly services, you will need to:
- Create a Bronto account. Book a demo with Bronto to create an account with them.
- Generate an API key in Bronto. To generate a Bronto API key, refer to their API Keys documentation.
For additional details on how Bronto works with Fastly, check out their documentation.
Adding Bronto as a logging endpoint
Follow these instructions to add Bronto as a logging endpoint:
- CDN
Review the information in our guide to setting up remote log streaming.
- In the HTTPS area, click Create endpoint button.
- Fill out the Create an HTTPS endpoint fields as follows:
In the Name field, enter a human-readable name for the endpoint.
In the Placement area, select where the logging call should be placed in the generated VCL. Valid values are Format Version Default and None. Read our guide on changing log placement for more information.
- In the Log format field, replace the placeholder log format and make the appropriate changes as shown in our log format recommendations section below.
- In the URL field, enter
https://ingestion.eu.bronto.io/?service_name=@field.host&service_namespace=fastly_cdn_service
to define the location of the log data in Bronto. We've described the use of specific parameters below. - In the Maximum logs field, leave as
0
(the default). - In the Maximum bytes field, enter
10485760
, as Bronto accepts payload up to 10MiB.
- Click Advanced options and fill out the fields as follows::
- In the Content type field, enter
application/json
. - In the Custom header name field, enter
x-bronto-api-key
. - In the Custom header value field, enter
<Bronto API Key>
, substituting the values for your Bronto API Key. - From the Method controls, select POST.
- From the JSON log entry format controls, select Newline Delimited as the appropriate log entry format to use.
- In the Select a log line format area, select Blank as the log line format for your log messages. Our guide on changing log line formats provides more information.
In the TLS hostname field, optionally enter a hostname to verify the logging destination server's certificate. This should be one of the Subject Alternative Name (SAN) fields for the certificate. Common Names (CN) are not supported.
- Leave TLS CA certificate, TLS client certificate, and TLS client key fields empty.
- In the Content type field, enter
Click Create to create the new logging endpoint.
Click Activate to deploy your configuration changes.
Log format recommendations
Here's an example format string for sending data to Bronto:
{ "timestamp": "%{strftime({"%Y-%m-%dT%H:%M:%S.%f%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_referrer": "%{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}
Using Event Fields for Service Name and Namespace
You can configure service name and namespace parameters within the URL to dynamically fetch values from log event content using the format @field.key
. For example:
https://ingestion.eu.bronto.io/?service_name=@field.geo_country&service_namespace=fastly
In this example, the geo_country
value from the event content will be used as the service name.
Once set up, logs for each field will be directed to the relevant service in Bronto, which allows you to send the log events per service using multiple HTTPS logging endpoints with Fastly.