ZMfilter - select events that have completed

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
phils01
Posts: 12
Joined: Fri Mar 19, 2021 5:04 pm

ZMfilter - select events that have completed

Post by phils01 »

Hello

I am in the process of setting up some new ZM servers, and copying filters from my older exisitng setup.

I have a raft of filters that work perfectly converting video after an event has completed.

However on the new instances, the filter kicks in while the event is still happening - which it never did before.

Is this a new behaviour? Do I need to change my filters to look for an "end date"? Am I misundertanding/not set something up correctly?

Thanks
Phil.
User avatar
iconnor
Posts: 3366
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: ZMfilter - select events that have completed

Post by iconnor »

Yup. It was never possible before to filter match on incomplete events. So now you have to specify.

Add an EndDateTime IS NOT NULL rule
phils01
Posts: 12
Joined: Fri Mar 19, 2021 5:04 pm

Re: ZMfilter - select events that have completed

Post by phils01 »

I thought I had this working because the "List Matches" was happily showing me all the events I expected.

HOWEVER, I noticed that none actually get processed.

The zmfilter log shows :
01/09/24 19:06:01.935925 zmfilter_3[2344208].ERR [ZoneMinder::Filter:465] [Unable to parse date string 'null']
01/09/24 19:06:01.937875 zmfilter_3[2344208].ERR [ZoneMinder::Filter:262] [Error parsing date/time 'null', skipping filter 'Export Events']
01/09/24 19:06:01.939464 zmfilter_3[2344208].ERR [main:269] [Error parsing Sql. skipping filter 'Export Events']

So it looks like it is expecting a datestring where I have 'null'.

There does not look like any way I can add a "is not null clause" to the filter.

I have dozens of events that are now on the system that have not been processed, can you let me know the currectly syntax - and why the "list matches" works but not the "execute".

Thanks
Phil
User avatar
iconnor
Posts: 3366
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: ZMfilter - select events that have completed

Post by iconnor »

Use IS or IS NOT for the operator. Not =
phils01
Posts: 12
Joined: Fri Mar 19, 2021 5:04 pm

Re: ZMfilter - select events that have completed

Post by phils01 »

Thank you - I worked it out from the code.

I was using "IS NOT" but I had 'null' in lowercase. The code in zmfilter.pl explicitly looks for 'NULL' in upercase to decide if it should parse the date field, I changed my filter to be NULL and the events have been processing happily all night.

} elsif ( $term->{attr} eq 'DateTime' or $term->{attr} eq 'StartDateTime' or $term->{attr} eq 'EndDateTime' ) {
if ( $temp_value eq 'NULL' ) {
$value = $temp_value;
} else {
$value = DateTimeToSQL($temp_value);
if ( !$value ) {
Error("Error parsing date/time '$temp_value', skipping filter '$self->{Name}'");
return;
}
$value = "'$value'";
}

Phil.
User avatar
iconnor
Posts: 3366
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: ZMfilter - select events that have completed

Post by iconnor »

Hmm, I see no reason for it to not be case sensitive. I'll fix that.
User avatar
iconnor
Posts: 3366
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: ZMfilter - select events that have completed

Post by iconnor »

Perhaps if IS/ISNOT is chosen, the value field should be limited to valid values.. I'll have to lookup what all the valid values are...
phils01
Posts: 12
Joined: Fri Mar 19, 2021 5:04 pm

Re: ZMfilter - select events that have completed

Post by phils01 »

Of if possible add a "Null" option to the data/time picker that pops up.
Post Reply