How to Prevent Log Data Loss When Using Elasticsearch In Production

4 MIN READ
MIN READ

One of the biggest challenges in infrastructure logging is ensuring that resources for storing and processing events are sufficient for scaling. Most businesses grow throughout the years, and as they grow, they accumulate more infrastructure and logged events. It’s critical that the logging stack captures, processes, and stores every event, or businesses could miss a significant event. 

Elasticsearch is common for searching and analyzing log data, but it needs an intermediate to send processed logs. The common intermediate is Logstash, which will temporarily cache and queue events when Elasticsearch is too busy. Logstash has a buffer that will hold events until Elasticsearch is ready again, leaving a single point of failure. If Logstash fails or its buffer overflows, logged events are lost. If it crashes or is taken offline for maintenance, all queued events are lost. Administrators deploy brokers with the ELK stack to help buffer and queue logged events during a spike in messages.

How does the ELK stack work?

Organizations rely heavily on their infrastructure. It not only powers their productivity, but it’s the foundation for their revenue. Whether the organization houses its infrastructure or provisions it in the cloud, it’s a necessary part of business productivity. Small businesses may not have log management in place. Still, spikes in growth and an increase in provisioned IT resources will require logging so that administrators can identify issues before they cause downtime.

Traditionally, organizations might store only a few logs on the network, but enterprise businesses now could experience terabytes of data from hundreds of components every day. Employees can’t read and analyze these events effectively, prompting the need to implement indexing and storage tools such as Elasticsearch. This tool centralized logged events, so administrators no longer needed to SSH into machines and grep logs to find specific events. 

Elasticsearch remedied indexing and storage issues, but administrators came across new ones. They needed a way to queue messages and avoid disruption from dropped events that could not be indexed quickly enough in Elasticsearch. Logstash will aggregate events, but it does not have the scaling capabilities to process large quantities of data during message spikes. 

The ELK stack (Elasticsearch, Logstash, and Kibana) helps manage this issue, providing the enterprise a complete log management solution. Logstash drops logs when overloaded, resulting in the eventual addition of a buffering agent (or broker) to the stack to help manage spiked volumes of events. The three common broker agents are Redis, Kafka, and RabbitMQ. A broker will add better buffering to the log management solution to hold events until Logstash can process them and send them off to Elasticsearch.

What do brokers do?

In a smaller environment, a broker may not seem necessary, but issues arise when there are spikes in logged events. This spike could result from additional resources pouring into  aggregation, a system failure, or a cybersecurity event. When a spike occurs, your Logstash service could get overloaded and begin to drop events. It can also happen when Elasticsearch cannot handle more events, and Logstash needs to pause the pipeline flow. Should any resource in your pipeline slow from a spike in logged events, the entire stack could be affected, and you could lose data.

A broker is an added resource that helps manage this issue. It adds a better buffer to the stack so that you no longer rely on Logstash to buffer and queue messages. Because Logstash doesn’t scale for unforeseen spikes in data, you eliminate the risk of losing events with brokers who collect data from producers. Any spikes in data will be queued much more efficiently and sent to Logstash once it’s free, meaning that Logstash could fail or go down for maintenance and the organization still preserves its event data. 


We’ll examine the three brokers popular in the enterprise.

RabbitMQ

For smaller organizations that want a simple broker solution, RabbitMQ is a solution that understands basic messaging protocols such as AMQP (Advanced Message Queuing Protocol). It’s a general messaging service that will ensure that Logstash and Elasticsearch have processed the latest events. Only then will it move additional data across the pipeline to prevent message deletion.

To handle spikes in data, RabbitMQ sets up a queue where messages are stored. It will hold these messages until confirmation from the target client (e.g., Logstash or Elasticsearch) that it received the message. If any target client fails, it cannot send a confirmation message, at which point RabbitMQ will hold it until the target client recovers.

When spikes in data happen, RabbitMQ will slow down, so one challenge is latency with high-volume traffic. RabbitMQ can be clustered, which will help with latency, but large enterprises don’t usually prefer how it handles overflow. The latency issues could create a backlog and delay real-time analysis tools, which could be an issue for environments requiring fast response times to ongoing events.

Redis

For larger enterprise environments, you will probably find either Redis or Apache Kafka. Redis is an in-memory data broker, which makes it optimized for performance. You might also see Redis referred to as a database (although there is no query language) because it can handle many different data structures in big data queries. This service is beneficial in log management. It can take several other data structures sent from your publishers, including strings, hashes, lists, ordered sets, bimaps, hyperloglogs, geospatial data, and streams.

The most significant disadvantage of in-memory queues is not having enough memory to support them. Redis will persist data to disk when memory is full, but caching on disk slows down your pipeline. Organizations will often use Redis in the Amazon Web Services (AWS) cloud to provide resources quickly but at a reduced cost. If Redis runs out of memory, you still risk event loss, so Redis is mainly implemented for its speed and not scalability.

Apache Kafka

For a solution with a push and pull model, Kafka offers a way to better store (called partitioning in Kafka) and send messages within a data pipeline. Publishers are the infrastructure resources generating logs, and subscribers are the aggregators and processes that pull logs from Kafka’s storage. It’s much more fault-tolerant than Redis and RabbitMQ since it uses disk caching and storage, which means it’s also a slower solution.

Kafka decouples publishers and subscribers so that either one can fail and Kafka will still function. It sends verification messages to publishers to ensure that messages are received and cached and holds them until subscribers can retrieve them. If subscribers slow down or fail, Kafka holds messages until they recover, making Kafka best for failover and reliability, but at the sacrifice of speed from disk-based storage.

Aside from slight performance loss, Kafka’s other disadvantage is that it requires Apache ZooKeeper in a clustered environment to track cluster state. Adding ZooKeeper creates more complexity which might be unwanted but necessary. Because it’s decoupled, Kafka also relies on consumers to track their messages in their queue.

Conclusion

If your organization is experiencing a loss in logged events, a broker could remediate the issue. These brokers all have their advantages and disadvantages. Another option is working with a SaaS solution like LogDNA. With our solution, you can avoid infrastructure complexities and all the burdens of rolling out your tools. 


Table of Contents

    Share Article

    RSS Feed

    Next blog post
    You're viewing our latest blog post.
    Previous blog post
    You're viewing our oldest blog post.
    What is Active Telemetry
    Launching an agentic SRE for root cause analysis
    Paving the way for a new era: Mezmo's Active Telemetry
    The Answer to SRE Agent Failures: Context Engineering
    Empowering an MCP server with a telemetry pipeline
    The Debugging Bottleneck: A Manual Log-Sifting Expedition
    The Smartest Member of Your Developer Ecosystem: Introducing the Mezmo MCP Server
    Your New AI Assistant for a Smarter Workflow
    The Observability Problem Isn't Data Volume Anymore—It's Context
    Beyond the Pipeline: Data Isn't Oil, It's Power.
    The Platform Engineer's Playbook: Mastering OpenTelemetry & Compliance with Mezmo and Dynatrace
    From Alert to Answer in Seconds: Accelerating Incident Response in Dynatrace
    Taming Your Dynatrace Bill: How to Cut Observability Costs, Not Visibility
    Architecting for Value: A Playbook for Sustainable Observability
    How to Cut Observability Costs with Synthetic Monitoring and Responsive Pipelines
    Unlock Deeper Insights: Introducing GitLab Event Integration with Mezmo
    Introducing the New Mezmo Product Homepage
    The Inconvenient Truth About AI Ethics in Observability
    Observability's Moneyball Moment: How AI Is Changing the Game (Not Ending It)
    Do you Grok It?
    Top Five Reasons Telemetry Pipelines Should Be on Every Engineer’s Radar
    Is It a Cup or a Pot? Helping You Pinpoint the Problem—and Sleep Through the Night
    Smarter Telemetry Pipelines: The Key to Cutting Datadog Costs and Observability Chaos
    Why Datadog Falls Short for Log Management and What to Do Instead
    Telemetry for Modern Apps: Reducing MTTR with Smarter Signals
    Transforming Observability: Simpler, Smarter, and More Affordable Data Control
    Datadog: The Good, The Bad, The Costly
    Mezmo Recognized with 25 G2 Awards for Spring 2025
    Reducing Telemetry Toil with Rapid Pipelining
    Cut Costs, Not Insights:   A Practical Guide to Telemetry Data Optimization
    Webinar Recap: Telemetry Pipeline 101
    Petabyte Scale, Gigabyte Costs: Mezmo’s Evolution from ElasticSearch to Quickwit
    2024 Recap - Highlights of Mezmo’s product enhancements
    My Favorite Observability and DevOps Articles of 2024
    AWS re:Invent ‘24: Generative AI Observability, Platform Engineering, and 99.9995% Availability
    From Gartner IOCS 2024 Conference: AI, Observability Data, and Telemetry Pipelines
    Our team’s learnings from Kubecon: Use Exemplars, Configuring OTel, and OTTL cookbook
    How Mezmo Uses a Telemetry Pipeline to Handle Metrics, Part II
    Webinar Recap: 2024 DORA Report: Accelerate State of DevOps
    Kubecon ‘24 recap: Patent Trolls, OTel Lessons at Scale, and Principle Platform Abstractions
    Announcing Mezmo Flow: Build a Telemetry Pipeline in 15 minutes
    Key Takeaways from the 2024 DORA Report
    Webinar Recap | Telemetry Data Management: Tales from the Trenches
    What are SLOs/SLIs/SLAs?
    Webinar Recap | Next Gen Log Management: Maximize Log Value with Telemetry Pipelines
    Creating In-Stream Alerts for Telemetry Data
    Creating Re-Usable Components for Telemetry Pipelines
    Optimizing Data for Service Management Objective Monitoring
    More Value From Your Logs: Next Generation Log Management from Mezmo
    A Day in the Life of a Mezmo SRE
    Webinar Recap: Applying a Data Engineering Approach to Telemetry Data
    Dogfooding at Mezmo: How we used telemetry pipeline to reduce data volume
    Unlocking Business Insights with Telemetry Pipelines
    Why Your Telemetry (Observability) Pipelines Need to be Responsive
    How Data Profiling Can Reduce Burnout
    Data Optimization Technique: Route Data to Specialized Processing Chains
    Data Privacy Takeaways from Gartner Security & Risk Summit
    Mastering Telemetry Pipelines: Driving Compliance and Data Optimization
    A Recap of Gartner Security and Risk Summit: GenAI, Augmented Cybersecurity, Burnout
    Why Telemetry Pipelines Should Be A Part Of Your Compliance Strategy
    Pipeline Module: Event to Metric
    Telemetry Data Compliance Module
    OpenTelemetry: The Key To Unified Telemetry Data
    Data optimization technique: convert events to metrics
    What’s New With Mezmo: In-stream Alerting
    How Mezmo Used Telemetry Pipeline to Handle Metrics
    Webinar Recap: Mastering Telemetry Pipelines - A DevOps Lifecycle Approach to Data Management
    Open-source Telemetry Pipelines: An Overview
    SRECon Recap: Product Reliability, Burn Out, and more
    Webinar Recap: How to Manage Telemetry Data with Confidence
    Webinar Recap: Myths and Realities in Telemetry Data Handling
    Using Vector to Build a Telemetry Pipeline Solution
    Managing Telemetry Data Overflow in Kubernetes with Resource Quotas and Limits
    How To Optimize Telemetry Pipelines For Better Observability and Security
    Gartner IOCS Conference Recap: Monitoring and Observing Environments with Telemetry Pipelines
    AWS re:Invent 2023 highlights: Observability at Stripe, Capital One, and McDonald’s
    Webinar Recap: Best Practices for Observability Pipelines
    Introducing Responsive Pipelines from Mezmo
    My First KubeCon - Tales of the K8’s community, DE&I, sustainability, and OTel
    Modernize Telemetry Pipeline Management with Mezmo Pipeline as Code
    How To Profile and Optimize Telemetry Data: A Deep Dive
    Kubernetes Telemetry Data Optimization in Five Steps with Mezmo
    Introducing Mezmo Edge: A Secure Approach To Telemetry Data
    Understand Kubernetes Telemetry Data Immediately With Mezmo’s Welcome Pipeline
    Unearthing Gold: Deriving Metrics from Logs with Mezmo Telemetry Pipeline
    Webinar Recap: The Single Pane of Glass Myth
    Empower Observability Engineers: Enhance Engineering With Mezmo
    Webinar Recap: How to Get More Out of Your Log Data
    Unraveling the Log Data Explosion: New Market Research Shows Trends and Challenges
    Webinar Recap: Unlocking the Full Value of Telemetry Data
    Data-Driven Decision Making: Leveraging Metrics and Logs-to-Metrics Processors
    How To Configure The Mezmo Telemetry Pipeline
    Supercharge Elasticsearch Observability With Telemetry Pipelines
    Enhancing Grafana Observability With Telemetry Pipelines
    Optimizing Your Splunk Experience with Telemetry Pipelines
    Webinar Recap: Unlocking Business Performance with Telemetry Data
    Enhancing Datadog Observability with Telemetry Pipelines
    Transforming Your Data With Telemetry Pipelines
    6 Steps to Implementing a Telemetry Pipeline
    Webinar Recap: Taming Data Complexity at Scale