title: How can I check for repeated strings with check-tail plugin in Sensu?
body: <p>I am using sensu and the <a href="https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/blob/master/bin/check-tail.rb" rel="nofollow noreferrer">check-tail.rb</a> plugin to alert if any errors appear in my app logs. The problem is that I want the check to be successful if it finds 3 or more error messages. </p>
  
  <p>The solution that I came up with is using a regex like: </p>
  
  <pre><code>\^.*"status":503,.*$.*^.*"status":503,.*$.*^.*"status":503,.*$\im
  </code></pre>
  
  <p>But it seems to not work because of the match function: instead of passing the variable as a ruby regex it passes it as a string (this can be seen <a href="https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/blob/master/bin/check-tail.rb#L68" rel="nofollow noreferrer">here</a>).</p>