Skip to content

Guance vs. ELK and EFK


Overview of ELK, EFK, and Guance

As software systems become increasingly complex, logs are usually generated by servers and written to different files, such as system logs, application logs, and security logs. These logs are stored on different machines. When a system failure occurs, engineers usually need to log in to each server and use Linux command-line tools such as grep/sed/awk to search for the root cause in the logs. Without a log system, the first step is to locate the server that handled the request. If multiple instances are deployed on that server, you need to find the log files in the log directory of each application instance. Each application instance may also have log rotation policies (for example, generating one file per day) and log compression and archiving policies. All these steps make it very difficult to troubleshoot failures and find root causes in a timely manner.

When deployed to the cloud, logging in to each node to check the logs of each module is basically infeasible. Not only is it inefficient, but sometimes security does not allow engineers to directly access physical nodes. In addition, large-scale software systems are generally deployed as clusters, which means that for each service, multiple identical pods are started to provide services externally. Each container generates its own logs. From the logs alone, you cannot tell which pod produced them, making it even more difficult to inspect distributed logs.

Therefore, if we can centrally manage these logs and provide centralized search capabilities, we can not only improve diagnostic efficiency but also gain a comprehensive understanding of the system status, avoiding the passive situation of fighting fires after an incident.

ELK

So what exactly is ELK? "ELK" is the acronym of three open-source projects: Elasticsearch, Logstash, and Kibana. Elasticsearch is a search and analytics engine. Logstash is a server-side data processing pipeline that can ingest data from multiple sources simultaneously, transform the data, and then send it to a "repository" such as Elasticsearch. Kibana allows users to visualize data in Elasticsearch using graphs and charts.

Elasticsearch

Elasticsearch is a JSON-based distributed search and analytics engine. It is accessed through a RESTful web service interface and uses schema-less JSON (JavaScript Object Notation) documents to store data. It is based on the Java programming language, which enables Elasticsearch to run on different platforms and allows users to search very large amounts of data at very high speed.

Main features

  • Distributed real-time file storage, with every field indexed and searchable
  • Distributed real-time analytics search engine
  • Can scale to hundreds of servers and process PB-level structured or unstructured data

image.png

Logstash

It is an open-source streaming ETL engine for data flows. It can build data flow pipelines within minutes. It is horizontally scalable and resilient, has adaptive buffering, and has a plugin ecosystem with over 200 integrations and processors. You can monitor and manage deployments with the Elastic Stack.

Main features

  • Can access almost any data
  • Can integrate with a variety of external applications
  • Supports elastic scaling

Logstash components

  • Inputs: Inputs mainly define rules for receiving data, such as collecting file contents.

  • Filters: Filters mainly filter or transform the transmitted data, such as using grok rules for filtering.

  • Outputs: Outputs mainly send received data according to the defined output modes, such as outputting to Elasticsearch.

image.png

Kibana

Kibana is an open-source data analysis and visualization platform and a member of the Elastic Stack, designed to work with Elasticsearch. You can use Kibana to search, view, and interact with data in Elasticsearch indexes. You can conveniently use charts, tables, and maps to analyze and present data in multiple ways.

Kibana makes big data easy to understand. Its simple, browser-based interface makes it easy to quickly create and share dynamic data dashboards to track real-time changes in Elasticsearch data.

EFK

EFK is not a piece of software, but a solution. EFK is the acronym of three open-source software projects: Elasticsearch, Fluentd, and Kibana, or Elasticsearch, Filebeat, and Kibana. Among them, Elasticsearch is responsible for log analysis and storage, Fluentd and Filebeat are responsible for log collection, and Kibana is responsible for visual presentation. They work together in perfect coordination and efficiently meet the requirements of many scenarios. Currently, it is one of the mainstream log analysis system solutions.

Fluentd

Fluentd is an open-source data collector designed for processing data streams and uses JSON as the data format. It uses a plugin-based architecture, has high scalability and high availability, and implements highly reliable information forwarding. In practice, information from various sources can first be sent to Fluentd. Then, according to configuration, Fluentd forwards the information to different destinations through different plugins, such as files, SaaS platforms, databases, or even another Fluentd.

Main features

  • Easy to install
  • Small footprint
  • Semi-structured data logging
  • Flexible plugin mechanism
  • Reliable buffering
  • Log forwarding

Fluentd components

Fluentd's Input/Buffer/Output structure is very similar to Flume's Source/Channel/Sink.

  • Input: Input receives data or actively fetches data. It supports syslog, HTTP, file tail, and so on.

  • Buffer: Buffer is responsible for the performance and reliability of data acquisition. Different types of buffers, such as file or memory, can be configured.

  • Output: Output is responsible for outputting data to destinations such as files, AWS S3, or other Fluentd instances.

image.png

Filebeat

Filebeat is a lightweight log collector implemented in Golang and is part of the Elasticsearch stack. In essence, it is an agent that can be installed on each node, reads logs from corresponding locations according to configuration, and reports them to the appropriate destination.

Filebeat is highly reliable and can guarantee at-least-once log delivery. It also considers various issues in log collection, such as resuming reading from breakpoints, file renaming, and truncated logs.

Filebeat does not depend on Elasticsearch and can exist independently. You can use Filebeat alone to report and collect logs. Filebeat has built-in common output components, such as Kafka, Elasticsearch, and Redis. For debugging purposes, it can also output to console and file. You can use the existing output components to report logs. Of course, you can also customize output components to let Filebeat forward logs to wherever you want.

Filebeat is actually part of elastic/beats. In addition to Filebeat, there are also Heartbeat and Packetbeat. These beats are all implemented based on the libbeat framework.

Filebeat components

  • Harvester: The main responsibility of the harvester is to read the contents of a single file. It reads each file and sends the contents to the output. A harvester is started for each file. The harvester is responsible for opening and closing files, which means file descriptors remain open during runtime. If a file is deleted or renamed while being read, Filebeat continues to read the file.

  • Prospector: The main responsibility of the prospector is to manage harvesters and find all file sources to read. If the input type is log, the prospector finds all files matching the path and starts a harvester for each file. Each prospector runs in its own Go goroutine.

Note: The Filebeat prospector can only read local files. It has no capability to connect to remote hosts to read stored files or logs. Because Filebeat's application scope is very limited, this article does not provide an extensive comparison of Filebeat.

image.png

Guance

DataKit

DataKit is a basic data collection tool running on the user's local machine. It is mainly used to collect metrics, logs, and other data generated by system operations, and aggregates them to Guance. In Guance, users can view and analyze their metrics, logs, and other data. DataKit is a critical data collection component in Guance; all data in Guance comes from DataKit.

  1. DataKit mainly collects various metrics through periodic collection, and then sends data to DataWay through HTTP(s) on a scheduled and quantitative basis. Each DataKit is configured with a corresponding token to identify different users.

  2. After receiving the data, DataWay forwards it to Guance. The data sent to Guance carries an API signature.

  3. After Guance receives valid data, it writes the data into different storage according to different data types.

For collection-type data services, some data loss is generally allowed (because the data itself is collected intermittently, and data during the intermittent period can be treated as data loss). The current data transmission chain has the following loss protection measures:

  1. If DataKit fails to send to DataWay due to network issues, DataKit caches up to 1,000 data points. When the cached data exceeds this amount, the cache is cleared.

  2. If DataWay fails to send to Guance for some reason, or cannot send in time due to high traffic, DataWay persists the data to disk. Later, when traffic decreases or the network recovers, the data is sent to Guance. Delayed data does not affect timeliness; the timestamp is attached in the cached data.

On DataWay, to protect the disk, the maximum disk usage can also be configured to prevent the node's storage from being exhausted. For data exceeding the limit, DataWay also chooses to discard the data. However, this capacity is generally set relatively large.

image.png

DataKit components

From top to bottom, DataKit is internally divided into three layers:

  • Top layer: includes the program entry module and some common modules
  • Configuration loading module: In addition to DataKit's main configuration (that is, conf.d/datakit.conf), the configurations of each collector are configured separately. If they were placed together, the configuration file could become very large and inconvenient to edit.
  • Service management module: mainly responsible for managing the entire DataKit service.
  • Tool chain module: As a client program, DataKit provides many other peripheral functions in addition to data collection. These are all implemented in the tool chain module, such as viewing documentation, restarting services, and updating.
  • Pipeline module: In log processing, Pipeline scripts (Grok syntax) are used to parse logs and convert unstructured log data into structured data. Corresponding data processing can also be performed on other non-log data.
  • Election module: When a particularly large number of DataKits are deployed, users can make the configuration of all DataKits the same, and then distribute the configuration to each DataKit through automated batch deployment. The significance of the election module is that in a cluster, certain data collection (such as Kubernetes cluster metrics) should be performed by only one DataKit (otherwise data will be duplicated and pressure will be placed on the source). When all DataKit configurations in a cluster are the same, the election module ensures that at most one DataKit performs collection at any time.
  • Documentation module: DataKit documentation is installed with the product. Users can visit http://localhost:9529/man to view the documentation list, or browse the documentation from the command line.
  • Transport layer: responsible for the input and output of almost all data
  • HTTP service module: DataKit supports the ingestion of third-party data, such as Telegraf/Prometheus. More data sources can be added later. Currently, such data is ingested through HTTP.
  • IO module: After each collection, each data collection plugin sends the data to the IO module. The IO module encapsulates unified data construction, processing, and sending interfaces, making it easy to connect data collected by various collector plugins. In addition, the IO module sends data to DataWay through HTTP(s) at a certain cadence (scheduled and quantitative).
  • Collection layer: responsible for collecting various data. According to collection type, it is divided into two categories:
  • Active collection: These collectors collect data at a configured fixed frequency, such as CPU, network interface traffic, and synthetic tests.
  • Passive collection: These collectors usually implement collection through external data input, such as RUM and Tracing. They generally run outside DataKit and can upload data to Guance through DataKit's open data upload API after some standardization processing.

image.png

Guance Platform

Based on powerful data collection capabilities, Guance builds observability across the entire chain: infrastructure, containers, middleware, databases, message queues, application tracing, frontend access, system security, and network access performance. Based on Guance standard products, users can quickly build complete observability for their own projects after correctly configuring DataKit collection. At the same time, based on the Line Protocol and Guance's scenario-building capabilities, users can also customize and conveniently integrate the metrics they need to observe, achieving further observability.

As a complete technical product oriented toward observability, Guance itself has many technical thresholds. Compared with various open-source solutions, Guance has emphasized from the very beginning how to effectively reduce users' learning costs and improve ease of use. Therefore, from DataKit installation and deployment, including all configurable capabilities, Guance tries to reduce configuration difficulty to align with the habits of most programmers and operations engineers, while improving the usability and professionalism of the entire UI so that users can quickly understand the product's purpose and value.

Supported Platforms Comparison

One of Logstash's original advantages is that it is written in JRuby, so it can run on Windows.

Fluentd only recently supported Windows because it no longer depends on event libraries centered on the Linux platform. Fluentd now supports Windows. You can also use the in_windows_eventlog plugin to track Windows event logs.

DataKit is the data collector officially provided by Guance. It has built-in collection scripts for multiple data sources, supports multiple data ingestion methods, and supports Windows, Linux, and Mac operating systems and ARM and x86 architectures. For log collection, it is fully compatible with all platforms.

Logstash

Linux and Windows

Fluentd

Linux and Windows

DataKit

Supports all platforms and supports client-side visual configuration management, greatly reducing the learning cost of installation, deployment, and complex configuration.

Event Routing Comparison

For event routing configuration, Fluentd's approach is more declarative, while Logstash's approach is procedural. Therefore, developers trained in procedural programming may find Logstash's configuration easier to get started with. In addition, Fluentd's tag-based routing allows clear expression of complex routing. However, based on complete product logic and powerful product components, Guance can provide functions such as event alerting and data browsing without relying on other products, truly achieving an observability closed loop. This not only ensures data security but also avoids complex configuration, delivering an excellent user experience.

Logstash Event Routing

Logstash routes all data into one stream and then uses if-then statements to send them to the desired destinations. The following is an example of sending error events in production to PagerDuty:

output {
if [loglevel] == "ERROR" and [deployment] == "production" {
pagerduty {
...
}
}
}

Fluentd Event Routing

Fluentd relies on tags to route events. Each Fluentd event has a tag that tells Fluentd where to route it. If you want to send error events in production to PagerDuty, the configuration is as follows:

<source>
  @type forward
</source>

<filter app.**>
  @type record_transformer
  <record>
    hostname "#{Socket.gethostname}"
  </record>
</filter>

<match app.**>
  @type file
  # ...
</match>

DataKit Proxy

As a component in Guance's powerful product suite, DataKit directly reports data to the cloud-based Guance platform for observation and analysis. Unlike Logstash and Fluentd, there is no need to provide event routing to transmit data to other tools for analysis, caching, and so on. Of course, to ensure user data security and to address the scenario where DataKit is deployed in an internal network that cannot access the Internet and needs to use a proxy server to access the Internet, DataKit's proxy configuration is very simple. You only need to enable the proxy option. With a simple configuration, you can experience rich product features.

[[inputs.proxy]]
  ## default bind ip address
  bind = "0.0.0.0"
  ## default bind port
  port = 9530

Plugin Ecosystem Comparison

Logstash, Fluentd, and DataKit all have rich plugin ecosystems covering many input systems (such as files and TCP/UDP) and filters (splitting and filtering by fields).

Logstash Plugins

Logstash manages all its plugins under the GitHub repo, with 200+ input, filter, and output plugins in total. They are jointly maintained by users and lack official maintenance and hosting.

image.png

Fluentd Plugins

Fluentd includes 8 types of plugins: input, parser, filter, output, formatter, storage, service discovery, and buffer, with 500+ plugins in total. However, only 10 of them are officially hosted. The rest are jointly maintained by users, lacking official maintenance, hosting, and technology stack support.

image.png

DataKit Plugins

DataKit includes powerful built-in features: dynamic grok syntax query debugging, fast data querying based on the self-developed DQL syntax, real-time inputs collection operation observation, edge computing capabilities, and visual client-side configuration and deployment of collection sources. It also supports 200+ officially maintained data source integrations and technology stack support, and is compatible with multiple external data sources such as Telegraf, Beats, Logstash, and Fluentd. What is more user-friendly is that it supports visual client-side plugin and agent management and real-time viewing of data collection status.

image.png

Queue Comparison

Logstash lacks a persistent internal message queue. Currently, Logstash has an in-memory queue that can hold 20 events (fixed size) and relies on external queues such as Redis for persistence during restarts. Fluentd has a configurable buffer system that can be in-memory or on disk, but configuring its reliability is relatively complex. DataKit has a built-in cache mechanism. You can achieve data caching by changing simple parameters based on server configuration.

Logstash Queue

Because Logstash lacks a message queue with built-in persistence, its built-in queue model is very simple. External queues such as Redis are needed to ensure persistence.

Fluentd Queue

Compared with Logstash, Fluentd has built-in reliability, but the configuration is relatively complex and the learning cost for users is high.

DataKit Queue

DataKit has a built-in cache mechanism. When a server running DataKit fails to send data to DataWay due to network issues, DataKit caches up to 1,000 data points by default to prevent data loss. The maximum cache size can also be controlled by modifying the DataKit configuration file. The configuration is simple, the barrier to use is low, and the learning cost is almost zero.

Log Parsing Comparison

Log analysis is a basic core technology within enterprises. It is used not only in security teams, but also in IT R&D teams and business teams. From a security perspective, security teams extract and analyze logs mainly to discover unknown security events and to perform traceability analysis of known security events. Another important purpose is national regulatory compliance requirements. From an IT R&D perspective, non-security technical teams within the enterprise mainly perform log analysis to discover hidden problems and analyze known issues, focusing on system monitoring and APM (APM includes all monitoring items that R&D teams care about). From a business perspective, business teams' requirements for log analysis focus more on risk control, operational promotion, user profiling, website profiling, and so on. Therefore, logs lying on hard disks are worthless. Log analysis technology realizes the value of log information. The higher the degree of log value realization, the more it indirectly reflects the company's technical strength.

Commonly used Logstash parsers include grok for parsing and constructing arbitrary text, mutate for performing general transformations on event fields, drop for completely deleting events, clone for making copies of events, and geoip for adding geographic location information about IP addresses. Common operations in Fluentd log parsing are filtering events by searching for values in one or more fields, enriching events by adding new fields, and deleting or masking certain fields to protect privacy and compliance. The plugins are relatively fewer, with only five plugins: record_transformer, filter_stdout, filter_grep, parser, and filter_geoip. DataKit log parsing includes Pipeline for parsing unstructured text data or extracting some information from structured text (such as JSON), using glob rules to specify log files more conveniently, automatic discovery and file filtering, an easy-to-use interactive Grok matching tool to lower the barrier to grok, and support for a large number of script functions to make data formats more flexible.

Logstash Log Parsing

Grok is currently the best way in Logstash to parse unstructured log data into structured and queryable content. Logstash currently has 120 built-in grok parsing templates. However, the grok parsing templates managed under the Logstash GitHub repo are jointly maintained by users and lack official technical support. Many business needs, including grok template performance tuning, must be explored by users themselves.

image.png

Fluentd Log Parsing

Fluentd's log parsing approach is similar to Logstash's, but the configuration is more flexible. However, it does not provide corresponding grok parsing templates and only provides some configuration examples. Users still need to configure parsing functions on their own based on the documentation examples. The barrier to use is relatively high. For problems in the configuration process, there is a lack of corresponding technical support, and users may need to rely on Google to solve them.

image.png

In a server environment with the same configuration, using an Nginx access log as an example, one log entry is 365 bytes and is structured into 14 fields:

image.png

In the following tests, different load levels are simulated by repeatedly writing this log to a file. The time field of each log entry takes the current system time, and the other 13 fields are the same.

Compared with real scenarios, the simulated scenario has no difference in log parsing. One difference is that a higher data compression rate reduces network write traffic.

Logstash

Logstash 7.1.0 parses logs through grok and writes them to Kafka (built-in plugin, with gzip compression enabled).

Log parsing configuration:

grok { 
patterns_dir=> "/home/admin/workspace/survey/logstash/patterns"

match=>{ "message"=>"%{IPORHOST:ip} %{USERNAME:rt} -
\"%{WORD:method} %{DATA:url}\" %{NUMBER:status} %{NUMBER:size} \"%{DATA:ref}\" \"%{DATA:agent}\" \"%{DATA:cookie_unb}\" \"%{DATA:cookie_cookie2}\" \"%{DATA:monitor_traceid}\" %{WORD:cell} %{WORD:ups} %{BASE10NUM:remote_port}" }

remove_field=>[ "message"]
}

Test results:

Write TPS Write Throughput (KB/s) CPU Usage (%) Memory Usage (MB)
500 178.89 25.3 432
1000 346.65 46.9 476
5000 1882.23 231.1 489
10000 3564.45 511.2 512

Fluentd

td-agent 4.1.0 parses logs through regular expressions and writes them to Kafka (third-party plugin fluent-plugin-kafka, with gzip compression enabled).

Log parsing configuration:

<source>
type tail
format /^(? <ip>\S+)\s(?<rt>\d+)\s-\s\[(?<time>[^\]]*)\]\s"(?<url>[^\"]+)"\s(?<status>\d+)\s(?<size>\d+)\s"(?<ref>[^\"]+)"\s"(?<agent>[^\"]+)"\s"(?<cookie_unb>\d+)"\s"(?<cookie_cookie2>\w+)"\s"(?
<monitor_traceid>\w+)"\s(?<cell>\w+)\s(?<ups>\w+)\s(?<remote_port>\d+).*$/
time_format %d/%b/%Y:%H:%M:%S %z
path /home/admin/workspace/temp/mock_log/access.log 
pos_file /home/admin/workspace/temp/mock_log/nginx_access.pos
tag nginx.access 
</source>

Test results:

Write TPS Write Throughput (KB/s) CPU Usage (%) Memory Usage (MB)
500 174.272 13.8 58
1000 336.85 24.4 61
5000 1771.43 95.3 103
10000 3522.45 140.2 140

DataKit

DataKit-1.1.8-rc3 uses Pipeline to parse unstructured text data.

# access log
grok(_, "%{NOTSPACE:ip} %{NOTSPACE:rt} - "%{NOTSPACE:method} %{NOTSPACE:url}\" %{NOTSPACE:status} %{NOTSPACE:size} \"%{NOTSPACE:ref}\" \"%{NOTSPACE:agent}\" \"%{NOTSPACE:cookie_unb}\" \"%{NOTSPACE:cookie_cookie2}\" \"%{NOTSPACE:monitor_traceid}\" %{NOTSPACE:cell} %{NOTSPACE:ups} %{NOTSPACE:remote_port}")

cast(status_code, "int")
cast(bytes, "int")

default_time(time)

Test results:

Write TPS Write Throughput (KB/s) CPU Usage (%) Memory Usage (MB)
500 178.24 8.5 41
1000 356.45 13.8 45
5000 1782.23 71.1 76
10000 3522.45 101.2 88

Log Collection Architecture Comparison

ELK Solutions

Solution 1

image.png

This is the simplest ELK architecture. The advantage is that it is easy to build and get started with. The disadvantage is that Logstash consumes significant resources and uses high CPU and memory during operation. In addition, there is no message queue cache, so there is a risk of data loss. Users need to be proficient in Logstash, Elasticsearch, and Kibana to skillfully use them to solve various complex business problems. In addition, maintainers of the Logstash cluster and Elasticsearch cluster need to be proficient in cluster performance optimization and resource management to ensure the normal operation of the business.

In this architecture, Logstash is distributed on each node to collect relevant logs and data, and after analysis and filtering, sends them to Elasticsearch on a remote server for storage. Elasticsearch stores data in compressed shards and provides a variety of APIs for users to query and operate on. Users can also more intuitively configure Kibana Web to query logs and generate reports from the data.

Solution 2

image.png

This is a relatively mature ELK architecture. The advantage is that with the introduction of Kafka, even if the remote Logstash cluster stops running due to a failure, data is stored first, avoiding data loss. The disadvantage is that the architecture is complex, the technology stack is complex and relatively difficult to get started with, and Logstash consumes significant resources with high CPU and memory usage. An additional Kafka cluster must be maintained, and in large scenarios, an additional Zookeeper cluster may also be needed. Users need to be proficient in Logstash, Elasticsearch, Kafka, and Kibana to skillfully use them and solve various complex business problems. In addition, maintainers of the Logstash cluster, Kafka cluster, and Elasticsearch cluster need to be proficient in cluster performance optimization and resource management to ensure the normal operation of the business.

This architecture introduces a message queue mechanism. Logstash Agents on each node first deliver data/logs to Kafka (or Redis), and the queue indirectly passes the messages or data to Logstash. After Logstash filters and analyzes the data, it delivers the data to Elasticsearch for storage. Finally, Kibana presents the logs and data to users. Because Kafka (or Redis) is introduced, even if the remote Logstash server stops running due to a failure, data will be stored first, avoiding data loss.

EFK Solutions

Solution 1

image.png

This is a more flexible EFK architecture. The advantages are greater flexibility, lower resource consumption compared with Logstash, and stronger scalability. The disadvantage is that reporting logs to a Logstash cluster for centralized processing requires a large Logstash cluster to provide compute power. In addition, users need to be proficient in Logstash, Elasticsearch, and Kibana to skillfully use them and solve various complex business problems. Maintainers of the Logstash cluster and Elasticsearch cluster also need to be proficient in cluster performance optimization and resource management to ensure the normal operation of the business.

In this architecture, the collection-side Logstash is replaced with Filebeat. Logstash and Elasticsearch clusters can be configured to support monitoring and querying of operations logs in large cluster systems.

Solution 2

image.png

On the basis of ELK, Filebeat is used as the log collection endpoint. The advantage is that in an ELK architecture where Logstash is used as the log collection endpoint, every server needs a Java environment because Logstash is Java-based. Filebeat, however, requires no dependencies. You can install it, modify the configuration file, and start the service. The disadvantage is that the technology stack is complex and relatively difficult to get started with, and Logstash consumes significant resources with high CPU and memory usage. An additional Kafka cluster must be maintained, and in large scenarios, an additional Zookeeper cluster may also be needed. Users need to be proficient in Filebeat, Logstash, Elasticsearch, Kafka, and Kibana to skillfully use them and solve various complex business problems. In addition, maintainers of the Logstash cluster, Kafka cluster, and Elasticsearch cluster need to be proficient in cluster performance optimization and resource management to ensure the normal operation of the business.

In this architecture, when the collection endpoint collects log files, we need to define a field in the Filebeat input, such as a log_topic field, to classify log files under a specified path into one category. In the output, we specify that the output goes to Kafka. Kafka acts as a message queue, receives all logs collected by Filebeat clients, and forwards them by category according to different log types (such as nginx, php, and system). In Kafka, different topics are created according to the custom log types defined in the input. Logstash receives messages from the Kafka message queue and, based on different topics in Kafka, writes logs by category into Elasticsearch. Kibana matches indexes in Elasticsearch to analyze, search, and display log content (of course, you need to design the visualizations yourself).

Solution 3

image.png

Fluentd is used as the log collection endpoint. The advantage is that Fluentd consumes far fewer resources than a Logstash cluster, making the architecture simpler and more flexible. The disadvantage is that Fluentd configuration is relatively complex, the barrier to use is relatively high, and it is difficult to get started quickly. The configuration files are relatively complex and cumbersome to modify. Users need to be proficient in Fluentd, Elasticsearch, and Kibana to skillfully use them and solve various complex business problems. In addition, maintainers of the Elasticsearch cluster need to be proficient in cluster performance optimization and resource management to ensure the normal operation of the business.

In this architecture, Fluentd collects program logs, stores the logs in an Elasticsearch cluster, and then connects Elasticsearch in Kibana to implement log queries.

Guance Architecture

image.png

As a basic data collection tool, DataKit is mainly used to collect metrics, logs, and other data generated by system operations, and aggregates them to Guance through DataWay. In Guance, users can view and analyze their metrics, logs, and other data. DataKit is a critical data collection component in Guance; all data in Guance comes from DataKit.

DataKit deployment and configuration are extremely simple and clear, and a visual client can help users manage DataKit. DataKit can collect not only log data, but also APM data, infrastructure, containers, middleware, network performance, and more. DataKit does not need to rely on components such as Elasticsearch and Kafka to supplement business functions, as Logstash and Fluentd do. With Guance, users do not need to consider these issues at all and can truly focus only on their own business optimization. DataKit users do not need to master a huge technology stack at high learning cost. A simple configuration is enough to combine with Guance to solve various complex business problems. The overall operation and maintenance costs of ELK and EFK are enormous. The Elasticsearch cluster alone requires significant expense. If you also consider hot/warm data separation to save costs, that is also a headache. With Guance, you do not need to consider these problems and can focus only on your business.

Hardware Cost Comparison

Price is a factor that everyone cares about. We use cloud services to compare the costs of ELK, EFK, and Guance.

ELK Cost

The basic components of Elastic are open source, and the main cost comes from hardware. We use different architecture compositions to collect logs from 10 servers, with 1 GB of logs per server per day, to calculate costs.

Logstash cluster + Kafka cluster + Elasticsearch cluster + Kibana

  • Logstash cluster
Billing Item Value Unit Price Cost (CNY)
Server 1 instance, 2 cores, 4 GB Monthly subscription: CNY 216.7/month 216.7
Storage 50 GB ESSD: CNY 0.5/GB 25
Total

241.7
  • Kafka cluster
Billing Item Value Unit Price Cost (CNY)
Server 3 instances, 4 cores, 16 GB Monthly subscription: CNY 788/month 2364
Storage 200 GB ESSD: CNY 0.5/GB 300
Total

2664
  • Elasticsearch cluster
Billing Item Value Unit Price Cost (CNY)
Server 3 instances, 2 cores, 8 GB Monthly subscription: CNY 383/month 1149
Storage 500 GB ESSD: CNY 0.5/GB 750
Total

1899
  • Kibana node
Billing Item Value Unit Price Cost (CNY)
Server 1 instance, 1 core, 2 GB Monthly subscription: CNY 104/month 104
Storage 50 GB ESSD: CNY 0.5/GB 25
Total

129

Based on storage and server configurations for a modest business scale, the total monthly cost of Logstash + Kafka + Elasticsearch + Kibana is CNY 5,175.4.

For the simple architecture without a Kafka cluster, the total monthly cost of Logstash + Elasticsearch + Kibana is CNY 2,511.4.

EFK Cost

The basic components of Elastic are open source, and the main cost comes from hardware. We use different architecture compositions to collect logs from 10 servers, with 1 GB of logs per server per day, to calculate costs.

Fluentd + Elasticsearch cluster + Kibana

  • Fluentd

Fluentd does not need to be deployed as a separate cluster, so Fluentd costs are not considered here. Only Elasticsearch + Kibana are calculated.

  • Elasticsearch cluster
Billing Item Value Unit Price Cost (CNY)
Server 3 instances, 2 cores, 8 GB Monthly subscription: CNY 383/month 1149
Storage 500 GB ESSD: CNY 0.5/GB 750
Total

1899
  • Kibana node
Billing Item Value Unit Price Cost (CNY)
Server 1 instance, 1 core, 2 GB Monthly subscription: CNY 104/month 104
Storage 50 GB ESSD: CNY 0.5/GB 25
Total

129

Similarly, based on storage and server configurations at the same business scale, the total monthly cost of Fluentd + Elasticsearch + Kibana is CNY 2,028.

Guance Cost

Guance itself does not charge product fees; it only charges based on storage usage. Pricing is calculated based on the number of DataKit collectors, the volume of log data, the volume of backup log data, the number of daily triggers, the number of time series per DataKit, the number of daily RUM sessions, and the number of APM traces. Similarly, we use collection of logs from 10 servers, with 1 GB of logs per server per day, to calculate costs.

Billing Item / Plan Free Plan Agile Plan
DataKit count Unlimited CNY 5/day
Time Series Total time series < 500 If time series per DataKit < 500, DataKit cost = number of DataKits × base unit price
If time series per DataKit > 500, the number of DataKits is calculated as follows:
- Number of DataKits = total number of time series in the current Workspace / 500 (rounded up)
- DataKit cost = number of DataKits × base unit price
Log data volume 2 million entries CNY 0.5/day (per 1 million entries)
Backup log data volume None CNY 0.2/day (per 1 million entries)
Trace count 10,000 CNY 1/day (per 1 million entries)
Session count / RUM PV count 100 sessions CNY 1/day (per 100 sessions or per 1,000 PVs)
Note: The lower cost of the above two dimensions is used as the final cost.
Synthetic API Test task count 5 CNY 1/day (per 1,000 runs)
Note: The count does not include API Test data generated by self-hosted nodes.
Synthetic Browser Test task count CNY 15/day (per 1,000 runs)
Note: The count does not include Browser Test data generated by self-hosted nodes.
Triggers 5,000 CNY 1/day (per 10,000 runs)
SMS sending count None CNY 0.1/day (per message)

10 servers are installed with DataKit. Log collection is 1 GB per server per day, with each entry calculated as 4 KB.

Billing Item Value Unit Price Cost (CNY)
Server 10 DataKits Monthly subscription: CNY 150/month 1500
Storage 1 GB per day CNY 0.5/day (per 1 million entries) 325
Total

1825

Similarly, based on the same business scale, the total monthly cost of Guance is CNY 1,825.

Operations Cost Comparison

Speaking of operations costs, we all know that to ensure cluster integrity, related operations are indispensable. Let's analyze the cost differences between the solutions.

ELK Operations Costs

Because the basic components of Elastic are all open source, clusters must be built by users themselves for operations and management. A complex ELK architecture may include a Logstash cluster + Kafka cluster + Elasticsearch cluster + Kibana node. First, if the user's business log volume is large and the calculation logic is complex, the scale and configuration requirements for the Logstash cluster, Kafka cluster, and Elasticsearch cluster are high. Second, clusters of different scales place high demands on the quality of operations personnel. Large clusters may encounter various problems, and maximizing resource utilization also requires sufficient experience in performance tuning. Finally, the technology stack requirements for operations personnel are essential.

EFK Operations Costs

Like ELK, EFK is also based on open-source components, and users need to build and manage clusters themselves. Compared with ELK, EFK uses Fluentd as the collector to gather data, which can eliminate the Logstash cluster and consumes fewer resources. However, the Elasticsearch cluster still needs to be dynamically scaled according to business scale. It also faces the same problem of high requirements for operations personnel under large clusters, and optimization is difficult. In addition, Fluentd configuration is more difficult than Logstash, and users can only rely on the experience of operations personnel for configuration. If script optimization is not done well, log parsing may impact the original business running on the server. To ensure stable operation of online business, the requirements for operations personnel may be even higher.

Guance Operations Costs

Guance is a SaaS-based observability platform. Users only need to deploy one DataKit on the server where data needs to be collected and enable the visual management feature to complete configuration management of the collection endpoint through remote visualization. The Guance platform can provide optimal log parsing templates to help users maximize performance while minimizing pressure on servers. With simple configuration, business logs can be parsed, allowing users to focus more on business optimization and expansion instead of investing energy in optimizing collection endpoints and log parsing clusters. In addition, Guance provides complete observability functions through the entire chain: infrastructure, containers, middleware, databases, message queues, application tracing, frontend access, system security, and network access performance. Users can also build their own observation scenarios based on business needs without spending energy researching or modifying immature open-source products, truly achieving zero operations costs and focusing on business development.

Learning Cost Comparison

For building or using a log analysis system, the learning cost is an indispensable part. To use it well, you must first learn it well. Let's look at how difficult it is to get started with each solution.

ELK Learning Cost

Because Elastic's components are all open source, clusters need to be built by users themselves. Therefore, when using the ELK stack for log analysis and processing, learning ELK environment preparation and ELK component configuration is essential. For example, you need to first build an understanding of Elasticsearch, master Elasticsearch basics, master Elasticsearch index operations, plan Elasticsearch clusters well, and optimize performance configurations for the open-source versions of Logstash and Elasticsearch.

EFK Learning Cost

Like ELK, EFK also requires learning these contents. In addition, because Fluentd configuration is more flexible than Logstash, the learning cost is correspondingly higher, and performance optimization depends more on experience. Compared with Logstash, which provides 120+ grok templates, Fluentd requires users to learn more by referring to documentation before they can actually use it well.

Guance Learning Cost

For users, only DataKit is deployed in the environment for data collection with Guance. The official documentation basically provides configuration references and usage guidance for the data collection configurations users need (currently covering 200+ technology stacks). If users want log analysis, business observation, or distributed tracing, they only need to learn how to use the corresponding modules of the Guance platform and enable the corresponding DataKit collection items to complete business tracking and other requirements. This avoids the need to build open-source clusters to implement log analysis and other requirements, or to learn numerous technologies. Users can spend more energy on business problems instead of spending so much time learning so many technologies to keep open-source clusters running.

User Experience Comparison

Comparing product user experience is also important. What differences do different solutions bring to users when implementing the same functions?

ELK User Experience

To use ELK for log analysis, you first need to build Logstash, Kafka, and Elasticsearch clusters and a Kibana display node. Second, to implement data collection and parsing for certain components, you need to check whether the existing 120+ parsing templates contain what you need. If not, you may need to run a series of tests to implement data collection and parsing. When you find that collection consumes too much performance or parsing is too slow, debugging becomes a cumbersome process. At the same time, if the log increment is too large, you face Elasticsearch index optimization and frequent cluster scaling. Finally, to display a business view, you need to learn Kibana's KQL for data querying and display. To further track data in real time with alerts, you may rely on other open-source components. During use, more than 80% of the time from requirement to resolution is spent dealing with various problems in open-source components, and only a small portion of time is truly used for business analysis and optimization.

EFK User Experience

Using EFK for log analysis also requires building an Elasticsearch cluster and a Kibana display node. Because Fluentd's configuration is more flexible, users may need more time to configure and debug before successfully completing data collection and parsing. Using an Elasticsearch cluster also cannot avoid index optimization and cluster scaling. Finally, users need to learn Kibana for data querying and display. Likewise, more than 80% of the time from requirement to resolution is spent dealing with various problems in open-source components, and only a small portion of time is truly used for business analysis and optimization.

Guance User Experience

Using Guance to implement log analysis and other requirements is very friendly. First, installing and configuring DataKit, the data collection endpoint of Guance, is extremely simple. A single command is enough to complete installation and configuration. Second, for users' component log or data collection needs, Guance supports 200+ mainstream technology stacks, providing full support for infrastructure, containers, middleware, databases, message queues, application tracing, frontend access, system security, and network access performance. It also has a complete documentation system, and all user needs can be satisfied through the documentation. In addition, the DataKit collector provides a visual client to help users reduce usage difficulty. At the same time, the Guance platform provides a large number of official scenario views to help users better observe the health of their own business.

Guance provides full-chain observability across infrastructure, containers, middleware, databases, message queues, application tracing, frontend access, system security, and network access performance. Based on Guance's standard products, users can quickly build complete observability for their projects after correctly configuring DataKit. At the same time, based on the Line Protocol and Guance's scenario-building capabilities, users can customize and conveniently integrate the metrics they need to observe, achieving further observability.

Simple DataKit Installation

A single command is enough to install DataKit.

image.png

Convenient Collection Item Management

After DataKit client access is enabled, collection items can be modified in the DataKit client. A large number of built-in templates are also available. Users only need to enable the corresponding configuration based on what they want to collect to complete data collection.

image.png

Rich Official Component Support

DataKit includes powerful built-in features: dynamic grok syntax query debugging, fast data querying based on the self-developed DQL syntax, real-time inputs collection operation observation, edge computing capabilities, and visual client-side configuration and deployment of collection sources. It also supports 200+ officially maintained data source integrations and technology stack support, and is compatible with multiple external data sources such as Telegraf, Beats, Logstash, and Fluentd.

image.png

More Powerful Product Capabilities

Guance provides full-chain observability across infrastructure, containers, middleware, databases, message queues, application tracing, frontend access, logs, system security, and network access performance. Based on Guance's standard products, users can quickly build complete observability for their projects after correctly configuring DataKit. It also supports anomaly detection libraries for multiple technology stacks and other features, giving users more choices for complex business issues.

image.png

Feedback

Is this page helpful?