0Pricing
System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) · 课时

Beats:轻量级数据采集器

了解能够将日志和指标发送到 ELK Stack 的 Beats 家族,掌握何时使用 Filebeat 而非 Metricbeat,以及 Beats 如何与 Logstash 协同工作。

Beats:轻量级数据采集器 是 CoddyKit 上的免费 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课时。 这是第 4 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

What Are Beats?

Beats are lightweight, single-purpose agents installed on your servers to collect data and ship it to Elasticsearch or Logstash. They use few resources, ideal for edge collection.

The Beats Family

Each Beat targets one data type.

  • Filebeat for log files
  • Metricbeat for system and service metrics
  • Packetbeat for network data
  • Heartbeat for uptime checks

Where Beats Fit

Beats sit at the source. They can ship directly to Elasticsearch, or to Logstash first when you need heavier parsing and enrichment.

app server -> Filebeat -> Logstash -> Elasticsearch -> Kibana

Filebeat Basics

Filebeat tails log files and forwards new lines. It tracks read position so it resumes after restarts without duplicating data.

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

Sending to Elasticsearch

For simple pipelines, point Filebeat straight at Elasticsearch.

output.elasticsearch:
  hosts: ["http://localhost:9200"]

Sending to Logstash

When you need grok parsing or enrichment, send to Logstash instead.

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

Metricbeat

Metricbeat collects metrics from the OS and from services through modules.

metricbeat.modules:
  - module: system
    metricsets: [cpu, memory, network]
    period: 10s

Modules and Dashboards

Beats ship with prebuilt modules that include parsing rules and ready-made Kibana dashboards, so you get visualizations without manual setup.

filebeat modules enable nginx
filebeat setup --dashboards

Back Pressure Handling

If the output is slow or down, Beats apply back pressure and buffer locally, slowing reads instead of dropping data.

Beats vs Logstash

Beats are light shippers; Logstash is a heavy processor. Use Beats at the edge for collection and Logstash centrally for transformation.

  • Beats: low footprint, on every host
  • Logstash: more CPU, fewer central nodes

A Typical Setup

Filebeat on each app server forwards logs to a Logstash pipeline that parses and enriches them before indexing in Elasticsearch for Kibana.

Quick Check

Choose the right Beat.

Recap

You learned that Beats are lightweight per-purpose shippers, that Filebeat handles logs and Metricbeat handles metrics, and that Beats can send directly to Elasticsearch or through Logstash for heavier parsing. Beats sit at the edge with a small footprint, complementing central Logstash processing.

常见问题解答

「Beats:轻量级数据采集器」课时是免费的吗?

是的 — 「Beats:轻量级数据采集器」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程的其余内容,请升级到 CoddyKit PRO。 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程共包含 4 节课。

「Beats:轻量级数据采集器」这节课中我会学到什么?

了解能够将日志和指标发送到 ELK Stack 的 Beats 家族,掌握何时使用 Filebeat 而非 Metricbeat,以及 Beats 如何与 Logstash 协同工作。 你通过在浏览器中直接运行的动手代码来练习 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry),全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 需要有经验吗?

无需任何先前经验。CoddyKit 上的 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 4 节课,共 4 节。

「Beats:轻量级数据采集器」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课中编写并运行代码吗?

能。每节 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. Elasticsearch:索引与搜索
  2. Logstash:数据摄取与处理
  3. Kibana:可视化与仪表板
  4. Beats:轻量级数据采集器
← 返回 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)