Skip to content

stakater/dockerfile-logstash-with-consul-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

Logstash with Consul Template

============================

A Consul Template powered Logstash docker container.

Supported Tags:

docker run stakater/logstash-with-consul-template:latest

To specify templates: docker run -d -v $(PWD)/templates:/templates stakater/logstash-with-consul-template:latest

This image is intended to be run together with Consul and Consul-Template

The daemon consul-template queries a Consul instance and updates any number of specified templates on the file system. As an added bonus, consul-template can optionally run arbitrary commands when the update process completes.

consul-template -consul-addr=$CONSUL_URL -template="/templates/logstash.ctmpl:/etc/logstash/conf.d/logstash.conf"

Sample Template

We have provided a sample template (in the templates directory).

To be able to use that template, you must make sure the following preconditions are met:

Preconditions

Consul Key-Value entries:

  • Port for receiving "beats" should be defined by the key /logstash/beatsPort
  • Grok pattern for logs of type syslog should be defined in the key /logstash/syslogPattern.
  • Default Grok pattern for applications without specific grok pattern should be defined by the key /logstash/defaultPattern.
  • Grok pattern (if any) for a specific application should be defined by the key /logstash/apps/<app_name>/grokPattern.
  • Multiline pattern (if any) for a specific application should be defined by the key /logstash/apps/<app_name>/multilinePattern.

Grok Pattern:

  • Time in the logs should be parsed and assigned to the key timestamp.
  • If using specific grok/multiline patterns for applications, logs must contain application name. The application name should be parsed and assigned to the key app_name.

About

Dockerfile of Logstash with consul template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages