logstash-config : parser and abstract syntax tree for Logstash config files
The Go package config provides a ready to use parser for Logstash configuration files.
The basis of the grammar for the parsing of the Logstash configuration format is the original Logstash Treetop grammar which could be used with only minor changes.
logstash-config uses pigeon to generate the parser from the PEG (parser expression grammar). Special thanks to Martin Angers (mna).
This package is currently under development, no API guaranties.
go get -t github.com/breml/logstash-config/...
cmd/ls-config-check
contains the source code for a small sample tool, which uses just allow to parse a given Logstash config file. If the file could be parsed successfully, the tool just exits with exit code 0
. If the parsing fails, the exit code is non zero and a error message, indicating the location, where the parsing failed, is printed.
ls-config-check <logstash-config-file>
could be used instead if bin/logstash -f <logstash-config-file> -t
, which is orders of magnitude faster 😃.
- Get and install pigeon.
- Run
go generate
in the root directory of this repository.
Copyright 2017 by Lucas Bremgartner (breml)