Search code examples
serializationlogstash

What is the format of logstash config file


Does logstash use its own file syntax in config file? Is there any parser or validator for config file syntax?

For anyone that does not use logstash but have idea about file formats here is a sample syntax:

input {
  file {
    path => "/var/log/messages"
    type => "syslog"
  }

  file {
    path => "/var/log/apache/access.log"
    type => "apache"
  }
}

Solution

  • Apparently command line arguments have been updated since the answers have been posted and --configtest and --config arguments are no longer valid. In order to ask Logstash (at least v5) to validate config file:

    bin/logstash -t -f config.conf
    

    With expanded arguments it looks like this:

    bin/logstash --config.test_and_exit --path.config config.conf