magnusbaeck / logstash-filter-verifier

Apache License 2.0
191 stars 27 forks source link

Display events when expected number of events does not equal actual number of events received #148

Closed jgough closed 2 years ago

jgough commented 2 years ago

When testing a configuration, if the number of events received does not equal the expected number of events then Logstash Filter Verifier outputs the following message:

☐ Compare actual event with expected event from test.yml:
Expected 7 event(s), got 5 instead.

Summary: ☐ All tests: 0/1
         ☐ test.yml: 0/1

However this makes debugging why only 5 events got received quite difficult. Currently I can see two methods of doing this:

  1. Temporarily change the number of expected events in the test to 5 so the events can be seen (albeit in an obviously incorrect diff).
  2. Set the loglevel of the daemon to debug and check the stdout: lines received.

Neither of these are a great user experience. It would be nice to be able to see the events received when the number does not match the expected. Thoughts?

breml commented 2 years ago

@jgough I created a small PR (#154), which shows a potential solution for this issue. What do you think?