Heartbeating using check_logfiles?

We try to implement heartbeat monitoring in log files. I.e. an application is expected to write specific strings regularely into a log file and I want to get an alert if the string is missing for a defined time.

First attempt: define a service using check_logfiles and submit the pattern using option “–criticalpattern”, but negate the pattern. We experienced that we got a lot of false alerts, i.e. an alert was generated, although the pattern was there.
Second attempt: “–criticalpattern” is set to “.*” and then define a “–criticalexception”, which contains the pattern. We are not sure if this could work. Further I do not know the difference between “–criticalexception” & “–okpattern=” and which one could be used in this situation.

Did anybody successfully implemented such monitoring?

https://labs.consol.de/de/nagios/check_logfiles/index.html

* --criticalexception=<regexp> / –warningexception=<regexp> Ausnahmen, die keinen Fehler bedeuten.

* --okpattern=<regexp> Muster, welches die Fehlerzähler zurücksetzt.
there is a reset so all the before are ignored

I would use a check_fileage on the file, so you know that the file is been modified or not. check logfiles with –criticalpattern=".*" --criticalexception=“your heartbeat line” should work

This method seems to be fine. Not sure, why my colleague said it would not work, maybe somthing in Icinga was fixed in the mean time.