Run handler command in dry-run mode with search pattern matching the word error ...should have report indicating new matches were found
./sensu-check-log -n -f /tmp/test.log --disable-event-generation --state-directory /tmp/test-state-dir
LogFileExpr: StateDir: /tmp/test-state-dir
Log file array to process: [/tmp/test.log]
Now Processing: /tmp/test.log
stateFile: /tmp/test-state-dir/_tmp_test.log
Resetting offset to zero, because cached offset is beyond end of file and modtime is newer than last time processed
File /tmp/test.log Match Count: 3
File /tmp/test.log Match Status 0 BytesRead: 52 New Offset: 52
{"path":"/tmp/test.log","match":"First error line"}
{"path":"/tmp/test.log","match":"Second error line"}
{"path":"/tmp/test.log","match":"Third error line"}
3. Run handler again and confirm report is is the same
Confirmed reproducible
Step to attempt to reproduce:
Create log file with multiple lines with the word error in it
Run handler command in dry-run mode with search pattern matching the word error ...should have report indicating new matches were found