Error parsing date/time - Filter issues

Forum for questions and support relating to the 1.30.x releases only.
Locked
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Error parsing date/time - Filter issues

Post 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
Screenshot at 2017-07-28 23-00-10.png (28.05 KiB) Viewed 4366 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
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Error parsing date/time - Filter issues

Post 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.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Re: Error parsing date/time - Filter issues

Post by Pedulla »

Positive logic like so:
Screenshot at 2017-07-31 09-34-34.png
Screenshot at 2017-07-31 09-34-34.png (27.55 KiB) Viewed 4343 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... ???
Last edited by Pedulla on Mon Jul 31, 2017 4:57 pm, edited 1 time in total.
mikb
Posts: 705
Joined: Mon Mar 25, 2013 12:34 pm

Re: Error parsing date/time - Filter issues

Post by mikb »

Try "Date/Time" "Less than" "21 days ago" (older than 21 days) ?
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Re: Error parsing date/time - Filter issues

Post 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!
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Error parsing date/time - Filter issues

Post 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.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Re: Error parsing date/time - Filter issues

Post 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.
FiltersTable.txt
(3.03 KiB) Downloaded 193 times
Also noticed, while testing that filter changes do not take effect until zm is restarted. Not sure if that is intended or not.
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Re: Error parsing date/time - Filter issues

Post by Pedulla »

table posted
Locked