# Custom Check for recent success events

**URL:** <https://discourse.sensu.io/t/custom-check-for-recent-success-events/3140>\
**Category:** Sensu Go\
**Tags:** checks\
**Created:** [July 6, 2023, 7:51pm UTC](https://discourse.sensu.io/t/custom-check-for-recent-success-events/3140 "2023-07-06T19:51:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![er320](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@er320](https://discourse.sensu.io/u/er320)\
**Post date:** [July 6, 2023, 7:51pm UTC](https://discourse.sensu.io/t/custom-check-for-recent-success-events/3140/1 "2023-07-06T19:51:12Z")

</div>

## Description of your problem

I’d like to create a new Check that can search a group of audit log files for ‘success’ events within a recent time period, similar to a heartbeat monitor. I don’t believe this is possible with the provided “sensu-check-log” command and its static regexp.

## Description of steps you’ve taken to attempt to solve the issue

I have a solution that uses a bash script to generate a regexp covering my desired time period. So then using find and grep I can determine a 0, 1, or 2 result. I just haven’t found an example of where to put this code. How do I define it as a ‘check’ that I can invoke from my existing monitoring YAML file?

And if you think this is a crazy idea, please do suggest a better way. I’m learning!

## Environmental information

### Operating system information

- RHEL

### Package versions

- Sensu Go: monitoring: version: 0.2.9 ?
- Etcd:
- PostgreSQL:

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/sensu/original/1X/ad88ecc0d60777fbbb8dad05fe976fca2a4d87b2.jpeg) [@system](https://discourse.sensu.io/u/system)\
**Post date:** [August 5, 2023, 7:52pm UTC](https://discourse.sensu.io/t/custom-check-for-recent-success-events/3140/2 "2023-08-05T19:52:04Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
