Files
oam/knowledge base/logstash.md
2025-01-21 21:03:32 +01:00

1.7 KiB

Logstash

Server-side data processing pipeline that ingests data, transforms it, and then sends the results to any collector.

Part of the Elastic Stack along with Beats, ElasticSearch and Kibana.

  1. TL;DR
  2. Further readings
    1. Sources

TL;DR

Usage
# Validate configuration files.
logstash -tf 'config.conf'
logstash --config.test_and_exit --path.config 'config.conf'


# Install plugins.
logstash-plugin install 'logstash-output-loki'

# List installed plugins.
logstash-plugin list
logstash-plugin list --verbose
logstash-plugin list '*namefragment*'
logstash-plugin list --group 'output'
input {  }

filter {
  mutate {
    add_field => {
      "cluster" => "us-central-1"
      "job" => "logstash"
    }
    replace => { "type" => "stream"}
    remove_field => [ "src" ]
  }
}

output {
  loki {
    url => "http://loki.example.org:3100/loki/api/v1/push"
  }
}

Further readings

Sources