sensu / sensu-check-log

The Sensu Go log file monitoring check plugin and asset.
MIT License
2 stars 3 forks source link

Wrong return status when processing multiple files #25

Closed jspaleta closed 3 years ago

jspaleta commented 3 years ago

From customer report

Test setup

  1. set up first log file with matching lines
    echo "error" > /tmp/test-logs/first-test.log
  2. setup second log file without matching lines
    echo "success" > /tmp/test-logs/first-test.log
  3. run dry run command test using -p and -e option to make sure both files are found
    ./sensu-check-log -d /tmp/test-state-directory -p /tmp/test-logs -e "log$" -m "error" --disable-event-generation --dry-run ; echo $?
  4. return status should be non-zero but it is not