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

Details

    • Change Request
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • Server (S)
    • None

    Description

      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;

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: