RousselTMLEARNING

Observability

Logstash: managing plugins and adopting Elastic Common Schema (ECS)

Written version of the video lessons: list, install, update and bundle Logstash plugins offline; understand ECS, ecs_compatibility mode and naming your fields.

1. Managing plugins #

Extending Logstash.

Commands #

Listing and installing plugins.
bin/logstash-plugin list --verbose            # plugins installés et versions
bin/logstash-plugin install logstash-filter-translate
bin/logstash-plugin update logstash-input-kafka
bin/logstash-plugin remove logstash-output-xyz

# Hors ligne : préparer un paquet sur une machine connectée, l'installer ailleurs
bin/logstash-plugin prepare-offline-pack logstash-filter-translate
bin/logstash-plugin install file:///tmp/logstash-offline-plugins-9.1.0.zip
TypeExamples
inputbeats, kafka, jdbc, s3, http
filtergrok, dissect, mutate, translate, geoip
outputelasticsearch, s3, kafka, file
codecjson, multiline, plain
Common mistake: Installing plugins by hand on each server: versions drift and a redeployment loses them. Build a Docker image or package bundling the required plugins.

2. Elastic Common Schema #

Common fields.

Why ECS #

ECS defines common field names: source.ip, host.name, http.response.status_code, log.level, event.category… When every source follows them, one query, dashboard or detection rule works across all data.

Custom fieldECS field
clientipsource.ip
statushttp.response.status_code
levellog.level
serverhost.name
useruser.name
filter {
  mutate {
    rename => {
      "clientip" => "[source][ip]"
      "status"   => "[http][response][status_code]"
      "level"    => "[log][level]"
    }
  }
}

ecs_compatibility mode #

Since version 8, Logstash plugins produce ECS-compatible fields by default (pipeline.ecs_compatibility: v8): the beats input, grok with ECS patterns, geoip… The disabled mode restores the old behaviour, useful to migrate legacy pipelines.

Good practice: Put your business fields outside ECS namespaces, under your own prefix (labels.* for simple keywords, or myapp.*): they will not clash with a future ECS version.

Related articles

Logstash: role, pipeline concept and installation

Written version of the video lessons: what Logstash is for, how a pipeline works (inputs, filters, outputs, q…

Logstash: inputs and outputs

Written version of the video lessons: common inputs (beats, file, tcp/udp, http, kafka, jdbc) and outputs (el…

Logstash: filters, grok and dissect

Written version of the video lessons: essential filters (mutate, date, json, kv, drop), the grok plugin and i…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!