Page 1 of 1
Error parsing date/time - Filter issues
Posted: Sat Jul 29, 2017 5:57 am
by Pedulla
zm 1.30.4
Ubuntu 16.04
Hi ZM Community,
Trying to setup a filter that deletes a certain monitors events older than X days.
Event Filter setup as follows

- Screenshot at 2017-07-28 23-00-10.png (28.05 KiB) Viewed 4358 times
Using Submit returns the expected results, however, when saved and allowed to run in the background zmfilter throws the following error:
2017-07-28 22:50:10.701910 zmfilter 11667 ERR Error parsing Sql. skipping filter '21DayContLimit' zmfilter.pl
2017-07-28 22:50:10.700960 zmfilter 11667 ERR Error parsing date/time '-21 day', skipping filter '21DayContLimit' zmfilter.pl
What am I missing?
Thanks in advance
Re: Error parsing date/time - Filter issues
Posted: Sat Jul 29, 2017 12:35 pm
by knight-of-ni
Try it w/o the negative logic.
Set your Date/Time expression to be greater than or equal to 21 day to delete events older than 21 days.
Re: Error parsing date/time - Filter issues
Posted: Mon Jul 31, 2017 4:40 pm
by Pedulla
Positive logic like so:

- Screenshot at 2017-07-31 09-34-34.png (27.55 KiB) Viewed 4335 times
Submit returns no results and when allowed to run in the background (even though submit failed to return results) the log file shows no error.
Maybe I've stumbled across something... ???
Re: Error parsing date/time - Filter issues
Posted: Mon Jul 31, 2017 4:49 pm
by mikb
Try "Date/Time" "Less than" "21 days ago" (older than 21 days) ?
Re: Error parsing date/time - Filter issues
Posted: Mon Jul 31, 2017 5:44 pm
by Pedulla
@miikb's suggestion works and is nicely "readable"; I'll probably stick with that.
But get this....
I removed the space between the quantity and the type and it's working as well.
"Date/Time" "Less than or equal to" "-21day"
Thanks all for the help.
Solved!
Re: Error parsing date/time - Filter issues
Posted: Mon Jul 31, 2017 7:48 pm
by knight-of-ni
Glad you got it working, but you probably did run across a bug.
Previously, I just wanted you to remove the negative to see if that was causing the issue.
It seems this line if returning false:
https://github.com/ZoneMinder/ZoneMinde ... pl.in#L211
Curious if you could find the filter in your database, and post the sql string verbatim.
Re: Error parsing date/time - Filter issues
Posted: Tue Aug 01, 2017 12:37 am
by Pedulla
efforting... stand by....
Sorry it took so long, had to learn how to use MySQL.... :/
There are two filters in this table, the 21 day filter throws the error, the 18 day filter works.
Also noticed, while testing that filter changes do not take effect until zm is restarted. Not sure if that is intended or not.
Re: Error parsing date/time - Filter issues
Posted: Sat Aug 05, 2017 6:42 am
by Pedulla
table posted