Closed nikkictl closed 4 years ago
@echlebek I used the presence of the state file, rather than the offset, to determine if the plugin is on it's first run. Let me know if this approach is more in line with your suggestion.
I worry it doesn't address the number of matches described in https://github.com/sensu/sensu-check-log/issues/6#issue-670043426 though. We'd have to read through the log file to determine the initial matches.
I've set the state file's offset on the first run with -ignore-initial-run
to the size of the log file. This optimizes the initial run since we don't have to read and analyze it, and configures the offset to the proper starting point for subsequent runs.
Signed-off-by: Nikki Attea nikki@sensu.io
Closes https://github.com/sensu/sensu-check-log/issues/5 Closes https://github.com/sensu/sensu-check-log/issues/6