From e7372816623e76cb4e5f69dbd0bf987ff52c9094 Mon Sep 17 00:00:00 2001 From: Tom Hendrikx Date: Fri, 5 Jul 2024 01:48:17 +0200 Subject: [PATCH] Reference test scripts in README --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a4f3e9c..4e3eed9 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,17 @@ Tests In the `test/` directory, there is a test suite that tries to make sure that no previously supported log line will break because of changing common patterns and such. It also returns results a lot faster than doing `sudo service logstash restart` :-). -The test suite needs the patterns provided by Logstash, you can easily pull these from github by running `git submodule update --init`. To run the test suite, you need a recent version of `ruby` (`2.6` or newer should work), and the `jls-grok` and `minitest` gems. Then simply execute `ruby test/test.rb`. NOTE: The whole test process can now be executed inside a docker container, simply by running the `runtests.sh` script. +The test suite needs the patterns provided by Logstash, you can easily pull these from github by running `git submodule update --init`. To run the test suite, you need a recent version of `ruby` (`2.6` or newer should work), and the `jls-grok` and `minitest` gems. Then simply execute `ruby test/test.rb`. NOTE: The whole test process can now be executed inside a docker container, simply by running the `test_grok_patterns.sh` script. Adding new test cases can easily be done by creating new yaml files in the test directory. Each file specifies a grok pattern to validate, a sample log line, and a list of expected results. Also, the example Logstash config file adds some informative tags that aid in finding grok failures and unparsed lines. If you're not interested in those, you can remove all occurrences of `add_tag` and `tag_on_failure` from the config file. +Additional test scripts are available for local tests (using docker containers): +- `test_grok_patterns.sh`: runs the test suite for the grok patterns in `postfix.grok` +- `test_logstash_config.sh`: validates the logstash config in `50-filter-postfix.conf` +- `test_pipeline.sh`: validates that the logstash config can be used in a simple logstash pipeline, and ensures that this results in parsed messages + Contributing ------------