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

XMLWordPrintable

    • Type: Change Request
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: None
    • Component/s: 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;

            Assignee:
            Andris Zeila
            Reporter:
            FP
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: