User Tools

Site Tools


wiki:logstash_pipelines

logstash pipelines

If you want to add multiple config files, use the pipelines.

Edit pipelines.yml and add the path to configs there e.g.

- pipeline.id: web_log_pipelined
  queue.type: persisted
  path.config: "/etc/logstash.d/web.conf"
- pipeline.id: log2
  queue.type: persisted
  path.config: "/etc/logstash.d/otherlog.conf"
- pipeline.id: log3
  queue.type: persisted
  path.config: "/etc/logstash.d/errors.conf"
...

Now you need to start logstash without any arguments, simply execute logstash, just make sure you are pointing to the right config. You can use LS_SETTINGS_DIR env variable to point to the config directory.

LS_SETTINGS_DIR=/etc/logstash.d/ logstash

Example systemd service file:

# /etc/systemd/system/logstash.service
[Unit]
Description=Massage various logs and forward them to opensearch/elasticsearch
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/logstash
Environment="HOSTNAME={{ hostname }}"
Environment="LS_SETTINGS_DIR=/etc/logstash.d/"
Restart=on-failure

[Install]
WantedBy=multi-user.target

Tested on

  • logstash-8.14.3
  • OpenJDK 64-Bit Server VM 17.0.11+9

See also

References

wiki/logstash_pipelines.txt · Last modified: 2024/10/17 15:02 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki