Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-7692

Allow to use "$" as jsonpath expression to detect invalid JSON

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • None
    • Server (S)
    • 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;

            wiper Andris Zeila
            hi0eeW7u FP
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: