-
Change Request
-
Resolution: Unresolved
-
Trivial
-
None
-
None
-
None
The use of "$" or "$." in jsonpath would allow to easily detect invalid JSON as part of item preprocessing. This is particularly useful for "raw items" that many other dependent items rely on. For such "raw items", a single preprocessing step "jsonpath with $" and a single trigger, e.g. "nodata(10m)" would be sufficient to detect invalid input data as the jsonpath preprocessing step marks the "raw item" as "Unsupported".
One might use a "JavaScript" preprocessing step on a "raw item" like this to get roughly the same:
try { JSON.parse(value); } catch (e) { Zabbix.Log(3, "Failed to parse JSON from value: " + value); throw "Failed to parse JSON"; } return value;