Skip to content

Widhian Bramantya

coding is an art form

Menu
  • About Me
Menu
elasticsearch

Log Management at Scale: Integrating Elasticsearch with Beats, Logstash, and Kibana

Posted on October 5, 2025October 5, 2025 by admin

Modern systems generate millions of logs every day, from API servers, databases, applications, and containers. Managing, searching, and visualizing all of these logs in real-time is not easy.

This is where the ELK Stack, Elasticsearch, Logstash, and Kibana, comes in.
When combined with Beats, it becomes one of the most powerful and flexible log management systems in the world.

In this article, we’ll explore how ELK works together, how data flows through the pipeline, and how to build a scalable log management architecture.

What Is ELK Stack?

ELK is short for:

  • Elasticsearch: stores and indexes log data
  • Logstash: processes and transforms logs
  • Kibana: visualizes data and dashboards

Later, Beats was added to make it easier to collect data from servers and containers.
Together, the full stack is now called the Elastic Stack (ELK + Beats).

Architecture Overview

Let’s understand how logs move through the system.

flowchart TD
    A[Applications / Servers] --> B[Beats]
    B --> C[Logstash]
    C --> D[Elasticsearch]
    D --> E[Kibana]

Each part has a specific role:

ComponentPurpose
BeatsLightweight agent that sends logs from servers
LogstashCentral processor to filter, parse, and enrich logs
ElasticsearchSearch and analytics engine storing structured logs
KibanaDashboard for visualization and alerting

Beats: Lightweight Data Shippers

Beats are small agents installed on servers to collect and send data.
They are written in Go and have minimal resource usage.

Common Types of Beats

BeatPurpose
FilebeatRead and ship log files
MetricbeatCollect CPU, memory, disk metrics
PacketbeatCapture network traffic
HeartbeatMonitor uptime and ping endpoints

Example: Filebeat → Logstash → Elasticsearch

See also  Elasticsearch Best Practices for Beginners

Configuration (simple Filebeat example):

filebeat.inputs:
  - type: log
    paths:
      - /var/log/nginx/*.log

output.logstash:
  hosts: ["logstash:5044"]

Each Beat batches, compresses, and retries automatically — ensuring logs are not lost.

Logstash: The Central Pipeline

Logstash is the heart of the Elastic Stack. It receives logs, processes them, and forwards them to Elasticsearch.

It uses a pipeline model with three stages:

flowchart LR
    A[Input] --> B[Filter] --> C[Output]

Example Configuration

input {
  beats {
    port => 5044
  }
}

filter {
  grok {
    match => { "message" => "%{COMBINEDAPACHELOG}" }
  }
  date {
    match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
  }
}

output {
  elasticsearch {
    hosts => ["http://elasticsearch:9200"]
    index => "nginx-logs-%{+YYYY.MM.dd}"
  }
}
  • Grok filters parse raw text logs into structured JSON.
  • Date filter ensures timestamps are consistent.
  • Index naming by date helps in retention and lifecycle management.
Pages: 1 2
Category: ElasticSearch

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Linkedin

Widhian Bramantya

Recent Posts

  • Log Management at Scale: Integrating Elasticsearch with Beats, Logstash, and Kibana
  • Index Lifecycle Management (ILM) in Elasticsearch: Automatic Data Control Made Simple
  • Blue-Green Deployment in Elasticsearch: Safe Reindexing and Zero-Downtime Upgrades
  • Maintaining Super Large Datasets in Elasticsearch
  • Elasticsearch Best Practices for Beginners
  • Implementing the Outbox Pattern with Debezium
  • Production-Grade Debezium Connector with Kafka (Postgres Outbox Example – E-Commerce Orders)
  • Connecting Debezium with Kafka for Real-Time Streaming
  • Debezium Architecture – How It Works and Core Components
  • What is Debezium? – An Introduction to Change Data Capture
  • Offset Management and Consumer Groups in Kafka
  • Partitions, Replication, and Fault Tolerance in Kafka
  • Delivery Semantics in Kafka: At Most Once, At Least Once, Exactly Once
  • Producers and Consumers: How Data Flows in Kafka
  • Kafka Architecture Explained: Brokers, Topics, Partitions, and Offsets
  • Getting Started with Apache Kafka: Core Concepts and Use Cases
  • Security Best Practices for RabbitMQ in Production
  • Understanding RabbitMQ Virtual Hosts (vhosts) and Their Uses
  • RabbitMQ Performance Tuning: Optimizing Throughput and Latency
  • High Availability in RabbitMQ: Clustering and Mirrored Queues Explained

Recent Comments

  1. Playing with VPC AWS (Part 2) – Widhian's Blog on Playing with VPC AWS (Part 1): VPC, Subnet, Internet Gateway, Route Table, NAT, and Security Group
  2. Basic Concept of ElasticSearch (Part 3): Translog, Flush, and Refresh – Widhian's Blog on Basic Concept of ElasticSearch (Part 1): Introduction
  3. Basic Concept of ElasticSearch (Part 2): Architectural Perspective – Widhian's Blog on Basic Concept of ElasticSearch (Part 3): Translog, Flush, and Refresh
  4. Basic Concept of ElasticSearch (Part 3): Translog, Flush, and Refresh – Widhian's Blog on Basic Concept of ElasticSearch (Part 2): Architectural Perspective
  5. Basic Concept of ElasticSearch (Part 1): Introduction – Widhian's Blog on Basic Concept of ElasticSearch (Part 2): Architectural Perspective

Archives

  • October 2025
  • September 2025
  • August 2025
  • November 2021
  • October 2021
  • August 2021
  • July 2021
  • June 2021
  • March 2021
  • January 2021

Categories

  • Debezium
  • Devops
  • ElasticSearch
  • Golang
  • Kafka
  • Lua
  • NATS
  • Programming
  • RabbitMQ
  • Redis
  • VPC
© 2025 Widhian Bramantya | Powered by Minimalist Blog WordPress Theme