Skip to content

Understanding Elastic, Logstash, and Kibana

Details of this picture follow the picture

The following text was provided by Google Gemini 2.0. The pictures were drawn by Gary Zeien. The output was reviewed.

Please provide an explanation of this picture that includes details on the key objects in the picture, the relationships, and a summary of the key points being covered in this picture.

This diagram illustrates the architecture and components of Elasticsearch, a distributed search and analytics engine based on Apache Lucene. It covers indexing, searching, data storage, and cluster management.

Key Objects:

  • Elasticsearch (the Engine): The core search and analytics engine.
  • Elastic Cluster: A group of interconnected Elasticsearch nodes working together.
  • Node: A single instance of Elasticsearch running on a machine (physical or virtual). Nodes have different roles within the cluster.
    • Master Node: Responsible for cluster-wide management tasks like creating/deleting indices, managing cluster state, and allocating shards to nodes. Cluster stability is highly dependent on a stable master node.
    • Data Node: Stores the indexed data (documents) and handles data-related operations like CRUD (Create, Read, Update, Delete), search, and aggregations. These operations are I/O, memory, and CPU intensive.
    • Ingest Node: Preprocesses documents before indexing. This can include tasks like parsing, filtering, and enriching data.
    • Coordinate Node: Routes search requests to the appropriate data nodes and aggregates the results.
  • Index: A collection of documents with similar characteristics. It's similar to a table in a relational database.
  • Document: A single unit of data within an index, represented in JSON format.
  • Shard: A subdivision of an index. Shards are distributed across data nodes to enable horizontal scaling and parallelism.
    • Primary Shard: The original shard where data is initially indexed.
    • Replica Shard: A copy of a primary shard, providing redundancy and improving search performance.
  • Mapping: Defines how fields in a document are indexed and stored. It specifies data types (e.g., text, keyword, date, integer) and other indexing options.
  • Properties (within Mapping): Specific settings for individual fields in the mapping, such as analyzers for text fields.
  • Index Template: A template used to automatically create indices with pre-defined settings, including mappings.
  • Dynamic Template: A part of the mapping that allows for automatic mapping of new fields based on their data type.
  • JSON File: A file containing data in JSON format, which is the typical format for documents ingested into Elasticsearch.
  • SQL Table: Data can also originate from SQL tables, which can be ingested into Elasticsearch.
  • Port: The network port Elasticsearch uses for communication (default 9200 for REST API).
  • REST API: The primary way to interact with Elasticsearch, using HTTP requests.
  • Plugin: Extends Elasticsearch's functionality with additional features.
  • Output (Logstash): Logstash can be used to process and send data to Elasticsearch.
  • Search Query: A request to search for documents within an index.
  • Lucene: The underlying search library that Elasticsearch uses.
  • Configuration (elasticsearch.yml): The main configuration file for Elasticsearch, defining cluster settings, node roles, and other parameters.
  • Filesystem (/usr/share/elasticsearch/data): The location on disk where Elasticsearch stores its data (indices, shards, logs).
  • Container or VM: The environment where Elasticsearch nodes are deployed.
  • Elasticsearch YAML: The configuration file for elasticsearch (elasticsearch.yml).

Relationships and Flow:

  1. Data Ingestion: Data (from JSON files, SQL tables, or other sources processed by Logstash) is ingested into Elasticsearch.
  2. Mapping and Indexing: The mapping defines how the data is indexed and stored. Documents are indexed into indices.
  3. Sharding and Replication: Indices are divided into shards, which are distributed across data nodes. Replicas provide redundancy.
  4. Search Queries: Users send search queries to Elasticsearch via the REST API.
  5. Query Execution: Coordinate nodes route queries to the relevant data nodes, which search their local shards using Lucene.
  6. Result Aggregation: Coordinate nodes aggregate the results from the data nodes and return them to the user.
  7. Cluster Management: The master node manages the cluster state, including shard allocation and node membership.
  8. Configuration: The elasticsearch.yml file configures the behavior of the Elasticsearch cluster and individual nodes.
  9. Plugins: Plugins extend Elasticsearch's capabilities.

Key Points:

  • Distributed Architecture: Elasticsearch is designed to be distributed, allowing it to scale horizontally by adding more nodes.
  • Sharding and Replication: These features provide scalability, high availability, and fault tolerance.
  • Indexing and Searching: Elasticsearch uses inverted indices based on Lucene to provide fast and efficient search.
  • Mapping and Analysis: Mappings define how data is indexed and analyzed, allowing for fine-grained control over search behavior.
  • Master Node Importance: A stable master node is crucial for cluster health and stability.
  • Data Node Resource Consumption: Data nodes require significant I/O, memory, and CPU resources, especially for large datasets and complex queries.
  • JSON as Core Data Format: Elasticsearch uses JSON as its native data format.

This diagram effectively summarizes the key components and concepts of Elasticsearch, highlighting how it works as a distributed search and analytics engine.


The following text was provided by Google Gemini 2.0. The pictures were drawn by Gary Zeien. The output was reviewed.

Please provide an explanation of this picture that includes details on the key objects in the picture, the relationships, and a summary of the key points being covered in this picture.

This diagram explains Role-Based Access Control (RBAC) within the Elastic Stack (Elasticsearch and Kibana). It details how users are granted permissions to access and manipulate data and resources within the cluster.

Key Objects:

  • Elastic RBAC: The core access control mechanism in Elasticsearch. It determines who can access what resources and what actions they can perform.
  • Users: Individuals or applications that interact with the Elastic Stack.
  • Roles: Collections of privileges. Roles are assigned to users, granting them specific permissions.
  • Cluster Privileges: Permissions that apply to the entire Elasticsearch cluster, such as cluster monitoring, node management, and index creation.
  • Index Privileges: Permissions that apply to specific indices, such as reading, writing, and deleting documents.
  • Field Access (within Index Privileges): Granular control over which fields within a document a user can access.
  • Document Privileges (within Index Privileges): Control access to individual documents based on criteria (e.g., specific field values).
  • Indices: Collections of documents.
  • Kibana Spaces: Isolated work environments within Kibana, allowing for organization and access control of dashboards, visualizations, and other Kibana objects.
  • Space Privileges: Permissions that apply to Kibana Spaces, such as creating dashboards, viewing visualizations, and managing spaces.
  • Configuration (elasticsearch.username): The username used by external applications (like Logstash or custom programs) to connect to Elasticsearch.
  • Logstash Instance: A data processing pipeline that can send data to Elasticsearch.
  • Logstash Configuration (logstash.yml): The configuration file for Logstash, which may contain authentication details for Elasticsearch.
  • Program (e.g., Python program running analytics): Custom applications that interact with Elasticsearch via its API.
  • Elastic API: Elasticsearch's RESTful API for interacting with the cluster.
  • RestAPI Client: A tool or library used to make requests to the Elastic API.
  • RBAC JSON: The JSON representation of roles, users, and their associated privileges.
  • Configuration of RBAC...: The process of defining and configuring roles and assigning them to users.
  • Kibana Config File (kibana.yml): The configuration file for Kibana, which includes settings related to authentication and authorization.
  • Kibana Instance: A running instance of Kibana.

Relationships and Flow:

  1. Users are assigned Roles: Users are granted access to resources by assigning them roles.
  2. Roles contain Privileges: Roles define a set of privileges, which can be cluster privileges, index privileges, field access, document privileges, or Kibana space privileges.
  3. Cluster Privileges affect the entire Cluster: Cluster privileges grant permissions to perform cluster-wide operations.
  4. Index Privileges affect specific Indices: Index privileges control access to specific indices.
  5. Kibana Spaces have Space Privileges: Kibana Spaces provide a way to isolate dashboards and visualizations, with their own set of permissions.
  6. Programs/Logstash use the Elastic API: External applications interact with Elasticsearch using its REST API, authenticating with a configured username.
  7. RBAC is configured via JSON or Kibana: RBAC is configured by defining roles and users (often in JSON format) and applying them to the Elasticsearch cluster. Kibana also provides a user interface for managing roles and users.
  8. Kibana uses RBAC for Authorization: When Kibana starts, it uses the RBAC configuration to authenticate and authorize users, controlling their access to Kibana features and data.
  9. Indices can be grouped: Indices can be logically grouped, often using prefixes (e.g., teamA-*, projectB-*). These groups are sometimes referred to as "namespaces."

Key Points:

  • Granular Access Control: RBAC allows for very granular control over who can access what within the Elastic Stack.
  • Role-Based Management: Managing permissions through roles simplifies administration and ensures consistency.
  • Different Levels of Privileges: RBAC provides different levels of privileges (cluster, index, field, document, space) to meet various security needs.
  • Kibana Integration: RBAC integrates with Kibana to control access to dashboards and visualizations.
  • Configuration via JSON or Kibana UI: RBAC can be configured either programmatically using JSON or through Kibana's management interface.
  • Indices Grouping for Management: Grouping indices simplifies permission management and allows for organization based on teams, projects, or other criteria.

This diagram effectively illustrates how RBAC works within the Elastic Stack, emphasizing the relationship between users, roles, privileges, and the various resources they control. It's a useful resource for understanding and configuring security in an Elastic deployment.


The following text was provided by Google Gemini 2.0. The pictures were drawn by Gary Zeien. The output was reviewed.

Please provide an explanation of this picture that includes details on the key objects in the picture, the relationships, and a summary of the key points being covered in this picture.

This diagram illustrates the relationship between Elasticsearch, Kibana, Logstash, and Beats within the Elastic Stack. It focuses on how data flows from various sources into Elasticsearch, how Kibana is used to visualize and interact with that data, and the role of other components in the ecosystem.

Key Objects:

  • Elasticsearch: The core search and analytics engine. It indexes and stores data in JSON format within indices.
  • Index: A collection of documents within Elasticsearch, similar to a table in a relational database.
  • Field: A specific piece of data within a document, defined by a mapping (schema).
  • JSON File: A file containing data in JSON format, a common source for data ingested into Elasticsearch.
  • Documents: Individual data entries within an index.
  • Mapping (implied by "Field"): Defines how fields in documents are indexed and stored (data types, analyzers, etc.).
  • Kibana: A visualization and exploration tool that works with Elasticsearch.
  • Elasticsearch Index (within Kibana): Kibana stores its own configuration and saved objects within a dedicated Elasticsearch index.
  • Index Patterns (within Kibana): Define which Elasticsearch indices Kibana can access and how to interpret their data.
  • Saved Objects (within Kibana): Stored configurations and objects within Kibana, including:
    • Visualizations: Charts, graphs, and other visual representations of data.
    • Dashboards: Collections of visualizations that provide an overview of key metrics.
    • Spaces (within Kibana): Isolated work environments within Kibana for organizing and managing dashboards and other saved objects.
  • Data Visualizer (within Kibana): A tool within Kibana for exploring and visualizing data.
  • Discover Services (within Kibana): A feature in Kibana that allows users to explore and search raw data within Elasticsearch indices.
  • Search (within Kibana): The search functionality within Kibana, powered by Elasticsearch's query DSL (Domain Specific Language) and implemented using Lucene.
  • Lucene: The underlying full-text search engine library used by Elasticsearch.
  • Logstash: A data processing pipeline that can collect, parse, and transform data from various sources before sending it to Elasticsearch.
  • Elastic Beats: Lightweight data shippers that collect data from various sources (logs, metrics, network data, audit data) and send it to Elasticsearch or Logstash. Specific Beats mentioned:
    • Filebeat: For collecting log files.
    • Metricbeat: For collecting metrics from systems and services.
    • Heartbeat: For monitoring uptime and availability.
    • Packetbeat: For network packet analysis.
    • Auditbeat: For collecting audit logs.
  • Container/Node/Server: The physical or virtual environment where the Elastic Stack components are deployed.
  • Config Files: Configuration files for each component (Elasticsearch, Kibana, Logstash, Beats) that define their behavior.

Relationships and Flow:

  1. Data Sources to Elasticsearch:
    • JSON files can be directly indexed into Elasticsearch.
    • Logstash can collect, process, and send data to Elasticsearch.
    • Beats collect data from various sources and send it to either Elasticsearch or Logstash.
  2. Elasticsearch and Kibana:
    • Kibana connects to Elasticsearch to access and visualize data.
    • Kibana stores its configurations and saved objects in a dedicated Elasticsearch index.
    • Index patterns in Kibana define which Elasticsearch indices are accessible.
  3. Kibana Functionality:
    • Kibana provides tools for creating visualizations, dashboards, and spaces.
    • The Data Visualizer allows for interactive data exploration.
    • Discover Services allow users to search and explore raw data.
  4. Search Powered by Lucene: Elasticsearch's search functionality, which is used by Kibana, is powered by the Lucene search library.

Key Points:

  • Data Ingestion Pipeline: The diagram shows the typical data ingestion pipeline: Beats → Logstash (optional) → Elasticsearch.
  • Kibana as Visualization Layer: Kibana provides the user interface for visualizing and interacting with data stored in Elasticsearch.
  • Elastic Stack Components Work Together: The diagram emphasizes how Elasticsearch, Kibana, Logstash, and Beats work together as a cohesive platform for search, analytics, and data visualization.
  • Flexibility of Data Sources: The Elastic Stack can ingest data from various sources, including JSON files and other systems through Logstash and Beats.
  • Saved Objects in Kibana: Kibana's configurations and visualizations are stored as saved objects within Elasticsearch, allowing for persistence and sharing.

In summary, this diagram provides a good overview of the Elastic Stack architecture, showing how data is ingested, stored, and visualized. It highlights the roles of each component and their interdependencies.


Last update: January 15, 2025
Back to top