Skip to content

Commit e737281

Browse files
committed
Reference test scripts in README
1 parent 9c49ea3 commit e737281

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ Tests
2424

2525
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` :-).
2626

27-
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.
27+
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.
2828

2929
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.
3030

3131
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.
3232

33+
Additional test scripts are available for local tests (using docker containers):
34+
- `test_grok_patterns.sh`: runs the test suite for the grok patterns in `postfix.grok`
35+
- `test_logstash_config.sh`: validates the logstash config in `50-filter-postfix.conf`
36+
- `test_pipeline.sh`: validates that the logstash config can be used in a simple logstash pipeline, and ensures that this results in parsed messages
37+
3338
Contributing
3439
------------
3540

0 commit comments

Comments
 (0)