Error sql zmfilter

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
brenusmannix
Posts: 3
Joined: Tue Mar 10, 2020 5:26 pm

Error sql zmfilter

Post by brenusmannix »

Hello,
I'm a newby and french guy so..
I have a error in zmfilter: Can't execute filter 'SELECT E.*, unix_timestamp(E.StartTime) as Time, M.Name as MonitorName, M.DefaultRate, M.DefaultScale FROM Events as E INNER JOIN Monitors as M on M.Id = E.MonitorId LEFT JOIN Storage as S on S.Id = E.StorageId WHERE (E.EndTime IS NOT NULL) AND ( E.AlarmFrames > -60 seconds ) AND ( E.Emailed = 0 ) ORDER BY E.Id DESC LIMIT 0,1', ignoring: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'seconds ) AND ( E.Emailed = 0 ) ORDER BY E.Id DESC LIMIT 0,1' at line 9.
When i try this request in phpmyadmin (ZM, filters) same result until i write [E.AlarmFrames > '-60 seconds'] !
Also when i try this filter with List Matches it's work!
What i've done wrong?
Thanks
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Error sql zmfilter

Post by iconnor »

AlarmFrames is an integer count... you seem to have specified -60 seconds. Perhaps you meant StartDate/Time
brenusmannix
Posts: 3
Joined: Tue Mar 10, 2020 5:26 pm

Re: Error sql zmfilter

Post by brenusmannix »

I think not because the filter i've used works, i receive an email, and LIST MATCHES works but in the log i have an error in mariadb because sql don't understand "-60 secondes" or "-60 secondes" whithout single quotation.
I don't understand why this filter works in LIST MATCHES and don't with sql in zmfilter.
brenusmannix
Posts: 3
Joined: Tue Mar 10, 2020 5:26 pm

Re: Error sql zmfilter

Post by brenusmannix »

Hi iconnor,
Of course you're right!
I needed a small nap to understand!

Thanks a lot.
User avatar
Gascoigne
Posts: 4
Joined: Wed Jun 09, 2021 7:43 am

Re: Error sql zmfilter

Post by Gascoigne »

You're right. The filter that you used isn't good. I made the same mistake a couple of weeks ago. I also received an email that told me about the error I got in MariaDB because SQL got the -60 second quotation. I tried to use another filter that I found on google. Well, that also didn't work, and I kept getting the same email. After that, I tried to make a sql server copy database to another server. I tried to use the same filters as I used on the original servers, and you know, everything worked just fine!
Post Reply