Cloudflare

Logs from the Edge

Nov 29, 2018Michael Tremante
Logs from the Edge
SummaryAI, from the source post

This post introduces an example Cloudflare Worker implementation that leverages sub requests to send traffic logs to an arbitrary location, specifically an Elastic stack. It details the Worker code for collecting log data (timestamp, URL, referrer, method, ray ID, IP, host, user agent, country code, colo, TLS version/cipher, status) and asynchronously posting it via a PUT request to an ELK endpoint. It also discusses how this enables real-time logging for all users, contrasting it with Enterprise Log Share (ELS) and suggesting improvements with Argo Tunnel and Access for securing the logging backend.

More from the Data Infrastructure & Analytics trail