QIAOPANG.COM · SELECTED ESSAYS (2013–2026) · 260 ESSAYSBrowse Chronologically (2013 → 2026) ↗
QiaoPang · Programmers LifeSelected Essays · Systems, Craft & Agentic Era
Timeline ↗

Beats: Monitoring and Log Processing

Beats: Monitoring and Log Processing

Before I knew it, one twenty-fourth of the new year had slipped by, and I found that I had not written even a few words—which must disappoint the readers of ‘Programmer’s Life.’ If my previous claims of being busy were just busywork, now I know what it means to be so busy that even the walk to the restroom must be made at 6 km/h. But busy or not, the WeChat account still needs updating. Today I’ll start with a short piece to thank you for your patient waiting.

There are plenty of off-the-shelf tools for system monitoring and log processing. Beyond the commercially successful New Relic and Datadog, there are also quite a few open-source solutions, such as the ELK stack (Elasticsearch, Logstash, Kibana) and Riemann. ELK is widely used, and you can find all sorts of success stories; especially after Amazon began offering Elasticsearch Service, the only thing left to worry about is installing and configuring Logstash, which greatly lowers the operational barrier.

Still, configuring Logstash alone is no easy task: you have to master a pile of input/output/filter plugins, understand the config-file syntax, learn to write working Grok patterns, and so on. Sometimes you just want to consume log files on disk. Is there a way to make a log agent plug-and-play without configuring Logstash?

Of course! The itchy-scratch law of the software world—when a problem itches unbearably for you, a fair number of other people are itching just as badly, so someone will scratch it—guarantees it. A startup, building on ELK for their own system, created a Beats system capable of handling most log formats. And so, like Found, the company doing Elasticsearch SaaS, they were acquired by Elastic (the parent company of ELK). Acquisition or not, what matters is that Beats remains open source under the Apache 2.0 license. Below, a brief introduction to this system.

Introduction to Beats

Beats is a set of collectors written in Go (it feels like Go is gradually taking over the ops-software market). They can pull information from the operating system, files, and the network, send it to Logstash, or send it directly to Elasticsearch, where it can be visualized. At present, the Beats project includes these subprojects:

Beats: Monitoring and Log Processing

The relationship between them looks like this:

Beats: Monitoring and Log Processing

We’ll focus mainly on Filebeat and Packetbeat.

Filebeat

Filebeat is mainly intended to replace Logstash Forwarder: you can capture information from system log files and send it to Elasticsearch. Installation is simple (on Red Hat):

$ curl -L -O https://download.elastic.co/beats/filebeat/filebeat-1.0.1-x86_64.rpm
$ sudo rpm -vi filebeat-1.0.1-x86_64.rpm

If your Elasticsearch cluster is not on localhost, modify the corresponding settings in /etc/filebeat/filebeat.yml. Then:

$ sudo /etc/init.d/filebeat start

After that, you can use Kibana to query your current log data.

Filebeat is fairly intuitive, so I won’t dwell on it.

Packetbeat

Packetbeat is a godsend worth having. Logging should be thought of in layers: network layer, web-server layer, application layer, etc. The higher the layer, the richer the means of collecting logs; yet the network layer—at least for me—had long been neglected. Packetbeat uses libpcap to capture packets directly from the network interface, performs protocol analysis, and stores the results in Elasticsearch, essentially making it a beefed-up Wireshark. Currently Packetbeat supports protocols such as DNS, HTTP, MySQL, Postgres, MongoDB, Redis/Memcached, and Thrift RPC—enough for a typical web application (though it probably ought to support AMQP as well). With Packetbeat you can do things that would otherwise require special handling at the application layer, such as discovering slow queries in the system in real time (whether SQL or MongoDB), or discovering the network topology in real time (in many complex server applications, even the developers don’t know which servers a given kind of traffic traverses or what it does there).

As an aside, vendors that build network equipment should develop systems like this for themselves or their customers. For themselves, it can aid debugging: visualize tcpdump data with the ELK stack to discover correlations. For customers, it can help them better identify latent risks and application bottlenecks, and provide better debugging capabilities.

I digress.

Packetbeat’s installation is a bit more involved; you need to install libpcap first:

sudo yum install libpcap
curl -L -O https://download.elastic.co/beats/packetbeat/packetbeat-1.0.1-x86_64.rpm
sudo rpm -vi packetbeat-1.0.1-x86_64.rpm

Then modify the Elasticsearch address in /etc/packetbeat/packetbeat.yml and run:

$ sudo /etc/init.d/packetbeat start

That’s all. I hope it’s useful.

MORE IN Systems & Architecture

Further Reading in This Column

View all essays in “Systems & Architecture” →

The Future of Logs: Rectifying Names

For a decade we built observability into a beautiful tower on a foundation of drifting strings—field names by convention, cardinality by luck, bills by endurance. This essay proposes a radical fix: use protobuf to give every observed event a proper name, unify logs, metrics, and audit into one versioned, owner-tagged, retention-aware event catalog, and keep an escape hatch called ForensicEvent for the unknown unknowns.

New Hope (2025–2026)10,772 chars · 24 min read

Abandoning Multi-Environment Entirely: Reshaping the Next-Generation Serverless Architecture with Rust and Pingora

When we return to first principles and reconsider what "compute" really is, we find that multi-environment setups are an illusion, Kubernetes is an over-abstraction, and Serverless cold starts and connection-pool storms are self-inflicted. This essay dissects an environment-less architecture built on Baggage Header routing, a Pingora smart gateway, Firecracker microVMs, and a Rust Data Bus — an attempt to answer: what should compute look like in the post-Kubernetes era?

New Hope (2025–2026)23,788 chars · 53 min read