Utilize Cloudflare Logs For Cost Optimization

Steve Waterworth
September 15, 2025
A realistic digital illustration of a beaver sitting at a sleek modern desk, typing on a keyboard while looking at a large curved monitor displaying glowing blue data visualizations and network diagrams, with a city skyline visible through the office windows at dusk.

Cloudflare is a content delivery network (CDN) that enables organizations to accelerate, protect, and optimize their websites, applications, and APIs. It performs as a reverse proxy between the internet and the website’s servers, providing DDoS protection, caching, and load balancing. Organizations use Cloudflare to improve website performance, reduce egress costs, and enhance security.

A Cloudflare Log

Cloudflare logs are structured logs in JSON format. Here are some of the key fields that provide useful information.

  • EdgeStartTimestamp - When Cloudflare received the request
  • EdgeEndTimestamp - When Cloudflare finished processing the request
  • ClientRequestQuery - The request parameters
  • EdgeResponseStatus - HTTP status code: 200, 404, 500, etc.
  • CacheStatus - The result of an attempt to serve a request from cache: HIT, MISS, EXPIRED, BYPASS
  • OriginIP - The IP address of the web server
  • OriginTLSVersion - TLS version of the connection to the origin server
  • OriginResponseDurationMs - Response time in milliseconds of the origin server
  • WAFAction - Web Application Firewall action, ALLOW, BLOCK, CHALLENGE
  • BotScore - Indication score for bot detection
  • ThreatScore - Threat intelligence score
  • ASN - Autonomous System Number of the client IP
  • ClientSSLProtocol - SSL/TLS version of the client
  • ClientCipher - Cipher suite used by the client

Acquiring Cloudflare Logs

You can configure Cloudflare to forward logs using several different methods. Splunk HEC (HTTP Event Collector) is an easy one to set up both on Cloudflare and Grepr. You create a HEC endpoint in Grepr by adding a Splunk integration and then configuring the Cloudflare log push to send to the Grepr endpoint. If you want them to end up in Splunk ultimately, the integration has already been created. If you want to send the logs somewhere else, like Datadog or New Relic, create an integration for that platform. Finally, create a Grepr pipeline to process the logs. Use the Splunk HEC as the source and whichever ultimate destination as the sink. If it is not Splunk, remove Splunk from the sink. The logs will now start flowing into Grepr.

Using Cloudflare Logs To Manage Cost

Cloudflare logs provide great detail on the traffic flowing through, which you can use for configuration modification changes to optimize costs. Reducing unnecessary bandwidth, compute, and log storage. To find the signal in the noise, consider the following fields and how they can help inform decision-making.

Typically, your cloud platform will be charging for egress, so the more data you send, the more it’s going to cost. Cross-referencing EdgeResponseBytes, which is the size of the payload sent to Cloudflare from the origin server, with OriginIP will inform you which services are utilizing the egress the most. Your engineers might be able to use this information to make some optimizations. Another source of high egress is cache misses (CacheStatus: MISS), where the payload was served by the origin and not from the Cloudflare cache. Check that Cache Everything is enabled for static assets, such as CSS, JavaScript, and images. Additionally, check the setting of Cache-Control headers. For example, setting this to max-age=31536000 would cache assets for a year.

Using Grepr To Stop Escalating Log Costs

Sending large amounts of logs from Cloudflare to your log aggregation and storage platform (Splunk, Datadog, New Relic) can seriously impact your observability costs. However, Grepr reduces log volume by 90% while retaining 100% insight. Verbose messages are sent through as summaries, while unique messages are passed through, allowing you to collect and extract intelligence from different log sources without being overly concerned with the cost implications.

Share this post

More blog posts

All blog posts
A cartoon beaver sits beside a large computer monitor, looking at a simplified dashboard with line charts and rows of color-coded log entries. The scene uses muted blues and browns with no yellow tint, and the beaver appears surprised while examining the data on the screen.
Product

Grepr Live View: Test Pipeline Changes with Production Data

Live View clones your production pipeline so you can test configuration changes against real data streams without any deployment risk.
December 10, 2025
Graphic showing the Gartner Cool Vendor 2025 badge on the left and the Grepr logo on the right, displayed on a blue background.
Announcements

Grepr Recognized by Gartner as a Cool Vendor for AI Driven Operations

Grepr was recognized by Gartner as a Cool Vendor in AI for IT Operations for its ability to give AI driven systems cleaner signal, lower cost, and real-time pattern detection that powers advanced LLM workflows.
December 3, 2025
A cartoon beaver sits on a fluffy cloud against a pastel sunset sky, holding the Grafana swirl logo with both paws. The beaver has a friendly expression, simple line-art features, and a flat tail resting behind it, matching a clean software-startup illustration style.
Product

Using Grepr With Grafana Cloud

Grepr cuts Grafana Cloud log costs by up to ninety percent through a simple configuration change that redirects your existing shippers to use semantic machine learning for automatic pattern aggregation while preserving all raw data in low cost storage.
November 30, 2025

Get started free and see Grepr in action in 20 minutes.