-
Type:
Documentation task
-
Resolution: Unresolved
-
Priority:
Trivial
-
Affects Version/s: 8.0.1rc1
-
Component/s: Documentation (D)
-
Sprint candidates
-
1
Hi,
new 8.0 feature allows to use javascript to match events,
problem is, this is not really documented as for now - in documentation, for "pattern match" there is just:
source: https://www.zabbix.com/documentation/8.0/en/manual/events/complex_event_processing#configuration
analyze sliding time window events based on a JavaScript script. The window is examined every second; events older than the duration are evicted, and the script is then run over the events that remain in it. When the script reports a match, the pattern match operations are executed for every event the window holds; the events stay in the window and are examined again a second later, until they age out.
A window can be forcibly closed by the "Close window" operation.
Problem is that some of functions are hardcoded in src/zabbix_server/cep/cep_js.c - for example, if pattern match have this script set:
var ev = get_events().filter(function (e) { return e.is_open && !e.is_copied; }); return ev.length >= 3;
CEP rule will fail with this error:
Cannot execute script: ReferenceError: identifier 'get_events' undefined
at [anon] (duktape.c:85196) internal
at [anon] (function:1) preventsyield.
As it should be "cep_get_events" instead of "get_events"
It would be great to at least share list of what can be used for pattern match javascript.