With the logstash 1.2.1 one can now have conditional to do various stuff. Even the earlier version's conf file can get complicated if one is managing many log files and implement metric extraction.
After looking at this comprehensive example, I really wondered my self, how can I detect any breakages in this configuration?
Any ideas.
since logstash has been upgraded and now the command will be something like (give the folder)
If you see some warning, but the error message is mixed together, and you didn't know which one have issue. You have to check its file one by one
For a syntax check, there is
--configtest
:To test the logic of the configuration you can write rspec tests. This is an example rspec file to test a haproxy log filter:
This will, based on a given filter configuration, run input samples and test if the expected output is produced.
To run the test, save the test as haproxy_spec.rb and run `logstash rspec:
There are lots of spec examples in the Logstash source repository.