Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-17186

4.0.11 JSON Path regression?

XMLWordPrintable

    • Sprint 60 (Jan 2020), Sprint 61 (Feb 2020), Sprint 62 (Mar 2020), Sprint 63 (Apr 2020), Sprint 64 (May 2020)
    • 0.5

      It seems like there was a regression in JSON Path parsing due to the changes in 4.0.11 (https://www.zabbix.com/rn/rn4.0.11), I built a template on 4.0.10 which worked fine until I migrated to 4.0.16.

       

      Steps to reproduce:

      1. create master item with JSON data, i.e.
        {"D:\\Xyz": {"free": 1234}}
      2. create discovery that returns
        {#NAME} = "D:\Xyz"

        (note single backslash)

      3. create dependent item inside discovery
      4. add preprocessing
        JSON Path -> $['{#NAME}'].free
      5. link to hosts, wait for discovery and keys
      6. item preprocessing fails

       

      So, simply put, you can't use single backslashes in the JSON Path parameter anymore, they need to be escaped?

       

       

      I know why this happens but I think the correct behavior is to allow single backslashes in user-facing fields (except maybe regex fields) and fix them in the backend if necessary.

       

      jsonpath.com seems to accept single backslashes (attachment)...

        1. zbx_template.png
          zbx_template.png
          10 kB
        2. zbx_jsonp.png
          zbx_jsonp.png
          19 kB
        3. zbx_examplejsondiscovery.txt
          0.1 kB
        4. zbx_examplejson.txt
          0.1 kB
        5. zbx_error.png
          zbx_error.png
          9 kB
        6. lld.txt
          0.1 kB

            MVekslers Michael Veksler
            jootuom Joonas Tuomisto
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: