Alert on every log entry

I would like to alert on every log line that I query in loki like {service="xxx", level="ERROR"}.
Or maybe there is a tool like elastalert, but for loki?

Hi! This is possible using Alerting rules:

Yes, I know that I can alert with the ruler, but it can alert only on vector or scalar expressions and I can’t get a single log line in alert with it.
Can You provide some example of how to do it?

You can only alert on metric queries in Loki, yes.

I’m quite clear on what you want, but if you want to be alerted whenever a new log line appears for this stream, you might consider defining an alert expression like count_over_time({service="xxx", level="ERROR"}[1m]) > 0

Ok, thank you. I will try.