I am having an issue with my syslog alert rule that contains a count. It never seems to trigger. Here is my alert’s override SQL statement:
SELECT * FROM devices,syslog WHERE (devices.device_id = ? AND devices.device_id = syslog.device_id) AND syslog.timestamp >= (DATE_SUB(NOW(),INTERVAL 5 MINUTE)) AND syslog.program = “SURICATA” HAVING COUNT(*) > 2
When I run a debug on “alerts” it matches, however, when I run a debug on “poller” I see the following message:
Rule #32 (Syslog - Resistance - Suricata - Over 5 Alerts in the last 5 minutes):
Error: SQLSTATE[42000]: Syntax error or access violation: 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),…) with no GROUP columns is illegal if there is no GROUP BY clause (Connection: mysql, SQL: SELECT * FROM devices,syslog WHERE (devices.device_id = 1 AND devices.device_id = syslog.device_id) AND syslog.timestamp >= (DATE_SUB(NOW(),INTERVAL 5 MINUTE)) AND syslog.program = “SURICATA” HAVING COUNT(*) > 2
)SQL[insert into
eventlog
(reference
,type
,datetime
,severity
,message
,username
,device_id
) values (?, ?, ?, ?, ?, ?, ?) [null,“alert”,“2024-11-05 08:03:29”,5,“Error in alert rule Syslog - Resistance - Suricata - Over 5 Alerts in the last 5 minutes (32): SQLSTATE[42000]: Syntax error or access violation: 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),…) with no GROUP columns is illegal if there is no GROUP BY clause (Connection: mysql, SQL: SELECT * FROM devices,syslog WHERE (devices.device_id = 1 AND devices.device_id = syslog.device_id) AND syslog.timestamp >= (DATE_SUB(NOW(),INTERVAL 5 MINUTE)) AND syslog.program = "SURICATA" HAVING COUNT(*) > 2\r\n)”,“”,1] 6ms]
Any help would be appreciated.