Your query could not be parsed - Custom SQL Alert

I’m trying to create a custom rule to alert when a port is flapping. I saw Alert port flapping up/down too much and used the following SQL:

MariaDB [librenms]> select * from eventlog where type=‘interface’ AND UNIX_TIMESTAMP(datetime) >= UNIX_TIMESTAMP(NOW() - INTERVAL 25 MINUTE) AND message LIKE ‘%lowerLayer%’ HAVING count(device_id) >= 4;
Empty set (0.086 sec)

It works directly with MySQL, however when I try to create an alert based on that, it says ‘Query could not be parsed’. Does the alert need additional arguments?

Can you publish the exact request you pasted into the LibreNMS WEBUI ?