RousselTMLEARNING

Article · Fluent Bit and Vector: lightweight log collection

Vector: topology and components

This article is available in French.

1. Les concepts #

Un graphe orienté.

Topologie #

Topologie Vector
Chaque composant déclare ses entrées (inputs) : Vector construit le graphe.

Vector organise le traitement en un graphe : des sources produisent des événements (logs, métriques ou traces), des transforms les modifient, des sinks les envoient. Chaque composant indique ses inputs, ce qui permet d'aiguiller un même flux vers plusieurs destinations.

2. Configuration #

YAML, TOML ou JSON.

Exemple #

# vector.yaml
api:
  enabled: true
  address: 0.0.0.0:8686

sources:
  app:
    type: file
    include: [/var/log/app/*.log]

transforms:
  parse:
    type: remap
    inputs: [app]
    source: |
      . = parse_json!(.message)
      .level = downcase(string!(.level))
      del(.password)

  erreurs:
    type: filter
    inputs: [parse]
    condition: .level == "error"

sinks:
  loki:
    type: loki
    inputs: [parse]
    endpoint: http://loki:3100
    encoding: { codec: json }
    labels: { app: "{{ app }}", level: "{{ level }}" }
    buffer: { type: disk, max_size: 268435488, when_full: block }

  alerte_console:
    type: console
    inputs: [erreurs]
    encoding: { codec: json }
vector validate vector.yaml
vector --config vector.yaml

Composants courants #

TypeComposants
Sourcesfile, kubernetes_logs, journald, syslog, http_server, kafka, opentelemetry, internal_metrics
Transformsremap, filter, route, sample, dedupe, throttle, log_to_metric, aggregate
Sinksloki, elasticsearch, aws_s3, kafka, clickhouse, prometheus_exporter, datadog_logs, console

3. Exploiter Vector #

Voir ce qui circule.

Outils #

vector top                       # débit et erreurs par composant, en direct
vector tap parse                 # afficher les événements qui sortent de « parse »
vector tap --outputs-of 'parse' --limit 5
Bonne Pratique : vector tap est l'outil de mise au point le plus utile : il montre les événements réels à n'importe quel endroit du graphe, sans rien modifier.

La source internal_metrics expose les métriques de Vector lui-même (événements reçus et envoyés, erreurs, taille des tampons), à envoyer vers Prometheus avec le sink prometheus_exporter.

📄 Vector : sources, transforms, sinks et topologie →

My progress

  • ⏱ Estimated time : ≈ 7 min

Sign in to track your progress and take notes. Sign in

✉️ Ask a question

Recommended Articles

Understanding the concept of score

The concept of score allows Elasticsearch to rank your documents by relevance during a search.

Understanding the Elastic Common Schema (ECS)

As always in our consulting engagements, we recommend that companies harmonise and standardise: k...

License consumption types

Understand the evolution of billing in Dynatrace: the difference between the old licensing model ...

Grafana Alloy: The importance of Self-Monitoring

Discover why and how to configure Grafana Alloy so that it monitors itself, collecting its own lo...

Grafana Alloy: Understanding and exploiting the User Interface (UI)

Discover how to enable, secure, and use Grafana Alloy's built-in web interface to visualize your ...

Grafana Alloy: Introduction and Architecture

Discover the fundamental concepts of Grafana Alloy, the transition from the static Agent to Alloy...

Grafana Alloy: Syntax and Configuration (Alloy Language: River)

As part of a Grafana training or observability training, master the declarative syntax of Grafana...

Grafana Alloy: Metrics Collection (Prometheus & Ecosystem)

Learn how to configure Grafana Alloy to collect, transform, and forward metrics using the Prometh...

Grafana Alloy: Log Management with Loki

Discover how to configure Grafana Alloy to read log files, journald, or network streams, process ...