Technical Resources
Educational Resources
Connect with Us
Fastly is a content delivery network (CDN) that caches HTTP content to improve the experience for those using your site or service. Fastly generates log messages for HTTP requests it receives and can send them in realtime to a Papertrail remote syslog destination.
The result is realtime tail, search, and alerts on Fastly traffic. When logs from related systems and apps are also being transmitted to Papertrail, this provides a complete view of logged activity in one place. If you aren’t familiar with Papertrail, start with a look at the event viewer.
To create a log destination that collects all Fastly logs under a single sender:
Fastly
).Papertrail
).logs2.papertrailapp.com:99999
, here’s how the resulting Fastly configuration would look:Often 99% or more of log messages from Fastly are successful requests for static assets like images and CSS files. In many cases, these HTTP 2xx and 3xx requests provide little operational value and are worth dropping. On the other hand, requests with HTTP 4xx and 5xx statuses are often very useful.
This filter regular expression can drop logs about requests for static assets, so that log data transfer is not consumed:
GET /.*?\.(css|png|jpg|gif|woff|ico|svg|js)|(GET|POST|HEAD) /.*? (1..|2..|3..|bingbot|Googlebot)
To apply it, visit Log Destinations, click Settings on the Fastly destination, click Add log filter, and paste the filter expression.
Fastly uses format strings to format the log message. The original version 1 log format only provided format string variables for a few items, requiring an X-Log-Message
header for anything else.
However, the newer version 2 log format is much more powerful, making the X-Log-Message
workaround obsolete. Here’s an example that logs several response headers, among other details:
for=request method=%m path=%U%q fwd=%h status=%>s bytes=%B cache=%{X-Cache}o cache_hits=%{X-Cache-Hits}o timing=%{X-Timer}o
Legacy logging objects can be automatically upgraded during the cloning/editing process.
The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.