logstash-config provides a parser and abstract syntax tree (AST) for the Logstash config format, written in Go
APACHE-2.0 License
The Go package config provides a ready to use parser for Logstash (github) 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/...
mustache
is a command line tool that allows to syntax check, lint and format Logstash configuration files. The name of
the tool is inspired by the original Logstash Logo (wooden character with an eye-catching mustache).
The check
command verifies the syntax of Logstash configuration files:
mustache check file.conf
The lint
command checks for problems in Logstash configuration files.
The following checks are performed:
id
attribute for each plugin in the Logstash configurationIf the --auto-fix-id
flag is passed, each plugin gets automatically an ID. Be aware, that this potentially reformats
the Logstash configuration files.
mustache lint --auto-fix-id file.conf
With the format
command, mustache returns the provided configuration files in a standardized format (indentation,
location of comments). By default, the reformatted file is print to standard out. If the flag --write-to-source
is provided, the Logstash config files are reformatted in place.
mustache format --write-to-source file.conf
Use the --help
flag to get more information about the usage of the tool.
go generate
in the root directory of this repository.Copyright 2017-2021 by Lucas Bremgartner (breml)