Create an alert when logs are in delay or are sent too early

Hello guys, I’m looking for a way to create an alert when logs are sent too close to one another (say for example 2 logs are sent within 15 seconds) or when they are sent in delay (say 2 minutes from one to another).

Can I create a condition like this on a monitor, or should I set up an anomaly check?

Thanks in advance