diff --git a/README.md b/README.md index 8b4d808..b590911 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ 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 also need `ruby 1.9` and the `jls-grok` gem. Then simply execute `ruby test/test.rb`. +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 also need `ruby 1.9` or higher, and the `jls-grok` gem. Then simply execute `ruby test/test.rb`. 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. diff --git a/test/error_0001.yaml b/test/error_0001.yaml new file mode 100644 index 0000000..fbf20b4 --- /dev/null +++ b/test/error_0001.yaml @@ -0,0 +1,7 @@ +pattern: POSTFIX_ERROR +data: "2DC5552A34: to=, relay=none, delay=63495, delays=63350/144/0/0, dsn=4.4.2, status=deferred (delivery temporarily suspended: lost connection with mta7.am0.yahoodns.net[98.136.216.22] while sending RCPT TO)" +results: + postfix_queueid: 2DC5552A34 + postfix_keyvalue_data: "to=, relay=none, delay=63495, delays=63350/144/0/0, dsn=4.4.2" + postfix_status: deferred + postfix_error_response: "delivery temporarily suspended: lost connection with mta7.am0.yahoodns.net[98.136.216.22] while sending RCPT TO"