Fluent Bit vs Vector: Shipping Logs Before They Ever Reach Loki

The database gets the credit. The agent tailing the file decides what it ever sees.

Contents

It is easy to take Loki’s design decisions to their logical conclusion and then stop paying attention to what feeds it, which is a mistake, because the agent doing the tailing decides what Loki ever gets to store. For a long time that agent was Promtail, Loki’s own purpose-built shipper. Grafana Labs deprecated it in 2025 in favour of the Grafana Alloy collector, and that forced a decision I’d been putting off: pick a general-purpose log shipper that isn’t tied to one backend’s release cycle, rather than migrate from one Loki-specific tool to another.

The two candidates that actually compete for that role are Fluent Bit and Vector, and they solve the same problem — read logs at the edge, parse and filter them, ship them somewhere — from different starting philosophies. Fluent Bit is a C-based, extremely lightweight member of the Fluentd/CNCF family, built to run in places where every megabyte of RAM is contested, like a sidecar in every pod of a cluster. Vector, from Datadog by way of Timber, is written in Rust, leans harder into being a full transformation pipeline with its own query-like language, and trades a slightly heavier footprint for expressiveness you don’t have to fight.

What actually differs: config shape over throughput

Both agents will tail a file, parse a line, and ship a batch to Loki without breaking a sweat — throughput isn’t where they diverge in a homelab-sized deployment, and I wouldn’t pick between them on a benchmark. The real difference is how you express “take this field, drop that one, reshape this JSON, and route it based on a label,” and that shapes how painful your config stays six months from now when you’ve forgotten why a rule exists.

Fluent Bit’s configuration is a sequence of INPUT, FILTER and OUTPUT stanzas (or the newer YAML format), each doing one narrow thing, chained by tag matching:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# fluent-bit.yaml
pipeline:
  inputs:
    - name: tail
      path: /var/log/containers/*.log
      tag: kube.*
      parser: docker

  filters:
    - name: kubernetes
      match: kube.*
      kube_url: https://kubernetes.default.svc:443
      merge_log: true
    - name: grep
      match: kube.*
      exclude: log ^.*healthcheck.*$

  outputs:
    - name: loki
      match: kube.*
      host: loki.example.local
      port: 3100
      labels: job=fluentbit, namespace=$kubernetes['namespace_name']

Vector expresses the same pipeline as sources, transforms and sinks, wired together explicitly by component name, with transforms written in Vector Remap Language (VRL) — a small, purpose-built scripting language rather than a filter plugin per behaviour:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
[sources.container_logs]
type = "file"
include = ["/var/log/containers/*.log"]

[transforms.parse_and_clean]
type = "remap"
inputs = ["container_logs"]
source = '''
. = parse_json!(.message)
if includes(.log, "healthcheck") {
  abort
}
'''

[sinks.loki]
type = "loki"
inputs = ["parse_and_clean"]
endpoint = "http://loki.example.local:3100"
labels.job = "vector"
encoding.codec = "json"

The Fluent Bit version reads like a checklist of plugins; the Vector version reads like a small program. Neither is objectively better — the checklist style is easier to review at a glance and harder to make do something genuinely novel, while VRL is easier to use for a transformation nobody’s already written a filter plugin for, at the cost of needing to actually learn a language. If your filtering needs are “drop health checks, add a namespace label,” Fluent Bit’s declarative style gets there with less to learn. The moment you need “parse this vendor’s inconsistent timestamp format, extract three fields with a regex, and conditionally redact one of them,” VRL stops fighting you and Fluent Bit’s lua filter — dropping into an actual embedded scripting language anyway — starts looking like the same complexity with worse ergonomics.

Fluent BitVector
Written inCRust
LineageFluentd family, CNCFTimber, now Datadog
Config shapeINPUT / FILTER / OUTPUT stanzas, or YAML pipelineSources, transforms, sinks
ScriptingLua filterVector Remap Language (VRL)
Default bufferMemory; filesystem optionalMemory; disk optional per sink

Resource footprint, honestly

Fluent Bit’s whole pitch is the C runtime and the small footprint, and in practice that holds up: a Fluent Bit instance tailing a handful of log files and shipping to Loki sits comfortably under 50MB of RSS on my boxes, which is why it’s the default choice for a DaemonSet-style deployment where you’re running one instance per node regardless of how busy that node is. Vector’s Rust runtime is memory-safe but not memory-light by the same margin — a comparable single-host deployment runs closer to 100–150MB, which is irrelevant on a single gateway box and adds up if you’re deploying a shipper per pod across a cluster of any size.

Abstract illustration of data streams from many small nodes converging on one central store.
A conceptual picture of many light agents feeding one destination. AI-generated illustration.

That difference has a practical consequence for where each tool tends to sit in an architecture: Fluent Bit at the edge, one per node or pod, doing the minimum viable parsing; Vector one layer up, as an aggregator that several Fluent Bit (or Vector) instances forward to, doing the heavier transformation work centrally where the RAM cost is paid once instead of per node. Running Vector as that aggregation tier and Fluent Bit as the edge tailer, rather than picking one tool for the whole pipeline, is a genuinely common pattern that plays to what each one is actually built for.

Log filescontainers, appsFluent Bitedge, per nodeVectoraggregatorLokiall lines, retentionAlert webhooklevel=error and aboveExample layout with generic names
One common layout: a light agent at the edge, the heavy transformation done once in the middle.

Where this fits next to Telegraf and metrics collection

It’s worth being clear that neither of these tools is a metrics agent — that’s a job for something like Telegraf, which polls inputs and pushes to a time-series store rather than tailing unstructured text. Fluent Bit and Vector both live in the logs lane specifically: unstructured or semi-structured text, parsed into structured fields, shipped to a log store. If you’re running Telegraf for metrics and a log shipper for logs, that’s two agents doing two genuinely different jobs rather than duplicated tooling — resist the urge to make one do both just because they’re both labelled “observability.”

Migrating off Promtail

The migration itself is mechanical once you’ve picked a direction: both agents ship a loki sink/output with the same label-based routing model Promtail used, so the labels your Grafana dashboards already query by (job, namespace, container) carry over unchanged as long as you replicate them in the new config. The place migrations actually go wrong is multiline handling — Java stack traces, Python tracebacks — because Promtail’s multiline stitching behaviour isn’t identical to either replacement’s, and a naive migration silently starts shipping each line of a stack trace as its own log entry. Test against a service that actually throws exceptions before calling a migration done — a quiet one that never logs a stack trace will never surface the difference.

Multiple sinks: the case for either agent over grep alone

The reason to run a shipper at all, rather than tail -f and grep over SSH the way I did for years, is fan-out: the same parsed log line can go to more than one destination without re-reading the file. A pattern I’ve settled into on the gateway box is shipping the full stream to Loki for retention and search, while a second, filtered sink sends only level=error or above to a webhook that actually pages me. Fluent Bit does this with two OUTPUT blocks matching the same tag; Vector does it with two sinks reading from the same transform, one of them adding a filter transform in between that drops anything below the error threshold before it reaches the webhook sink.

That fan-out is the actual argument for a real shipper over a cron job piping journalctl somewhere — the ability to treat one stream of log lines as several different downstream problems (retention, alerting, maybe a metrics counter derived from error rate) without re-parsing it three times, on log volumes neither agent will ever struggle to keep up with.

Structured logging changes the calculus

Everything above assumes you’re parsing unstructured or loosely-structured text into fields, which is the hard and unglamorous part of either tool’s job. If the applications you’re shipping from already emit structured JSON — which is increasingly the default for anything written in the last few years — a huge amount of the filter/transform complexity in both configs above simply doesn’t apply. Fluent Bit’s tail input with a JSON parser, or Vector’s file source piped straight into a remap transform that does nothing but rename a couple of fields, both become close to boilerplate.

That’s worth knowing before reaching for either tool’s more powerful features: check whether the actual problem is “my applications log unstructured text” before building an elaborate parsing pipeline to compensate for it. A five-line change to an application’s logging config is often less total effort than a robust Grok pattern or VRL script that has to handle every way a human-readable log line can vary.

Buffering and what happens when Loki is unreachable

Both agents buffer in-flight data rather than dropping it silently the instant the sink is unreachable, but the durability guarantees differ in a way that matters if you care about not losing logs during a Loki restart. Fluent Bit’s default buffering is in-memory, with an optional filesystem buffer (storage.type filesystem) that survives an agent restart; Vector defaults to an in-memory buffer too, with a disk buffer type available per-sink for the same durability trade. Neither ships with disk-backed buffering turned on out of the box, and on a homelab where Loki restarts are rare and brief, I’ve found the default in-memory buffering loses nothing in practice — but it’s a setting worth flipping deliberately rather than discovering the gap during an actual outage.

Troubleshooting

Loki rejects entries with “entry out of order.” Both agents can reorder lines across concurrent file reads under load; Loki’s out-of-order ingestion window (configurable, since Loki 2.4) absorbs small jitter, but a sustained flood of rejections usually points to clock skew between the shipper’s host and Loki rather than a bug in the shipper itself.

Fluent Bit’s Lua filter silently drops fields. Lua tables and Fluent Bit’s internal msgpack representation don’t map perfectly onto nested JSON — a nil in the wrong place in a returned table drops the whole record. Log the table with cjson.encode() inside the filter during development rather than debugging blind.

Vector’s VRL script won’t compile. VRL is strictly typed at the field level in a way JSON isn’t; parse_json! returning something that isn’t the shape a later line expects raises the error at compile time, well before anything runs. The error messages name the exact line and expected type, which is more useful than it sounds once you’re used to reading them.

Memory grows steadily under load on either agent. Almost always a downstream backpressure problem — Loki rejecting or slow-walking writes while the shipper buffers in memory waiting to retry. Check Loki’s ingestion rate limits before assuming a leak in the shipper.

Metrics from logs: a small trap either agent tempts you into

Both Fluent Bit and Vector can derive metrics from the log stream they’re already parsing — a counter incremented per error line, say — and it’s tempting to use that instead of instrumenting the application properly. Resist it past the simplest cases. A metric derived from grepping log text is only as reliable as the log format staying stable, and it breaks silently the day someone changes a log message’s wording without realising a dashboard depended on the old one. Proper metrics from an actual /metrics endpoint, scraped the way Prometheus and Grafana expect, don’t have that failure mode. Use the log-derived counter as a stopgap for something you haven’t instrumented yet, and replace it with the real thing once you have.

Which one to actually run

For a single-box homelab tailing container logs into Loki, Fluent Bit’s smaller footprint and simpler mental model win by default — you’re unlikely to need VRL’s expressiveness for “parse Docker JSON, add a label, ship it.” Reach for Vector specifically when your transformation logic outgrows what a filter plugin covers, or when you want one aggregation tier doing the heavy parsing for several lightweight edge agents feeding into it. Running both, in those two different roles, is the setup I’ve actually settled on rather than a hedge — they’re solving different halves of the same pipeline.

Only drop and label lines?Fluent Bit aloneyesMany nodes to feed?noFluent Bit edge, Vector aggregatoryesVector aloneno
A rule of thumb drawn from the sections above, for homelab-sized setups.
Smarc
Written by Smarc

Founder and editor of Aside House. A lifelong tinkerer who self-hosts far more than is sensible, hardens Linux boxes for fun, and prods the latest AI tools to see what they can really do. The how-to guides here are the notes Smarc wishes had existed the first time round.

Smarc is the editor of Aside House. The homelab, the hardware and the opinions are real; the guides are drafted with AI assistance. Infrastructure details are genericised on purpose.