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

Escaping backslash in jsonpath using LLD macro

XMLWordPrintable

    • Sprint 56 (Sep 2019), Sprint 57 (Oct 2019), Sprint 58 (Nov 2019), Sprint 59 (Dec 2019)
    • 5

      Steps to reproduce:

      1. Create LLD rule and use LLD macros:
      2. JSON for this LLD rule contains backslash "\" in property, which used in LLD macro
        [
        {
        "ProtectionGroup": "cluster-006-VM",
        "DataSource": "VM\\server-815",
        "ExecutionState": 2,
        "ErrorCode": 0,
        "ErrorString": "",
        "LastJobStarted": 1564851600,
        "LastSuccesfulJob": 1564851600
        },
        {
        "ProtectionGroup": "cluter-006-VM",
        "DataSource": "VM\\server-816",
        "ExecutionState": 2,
        "ErrorCode": 0,
        "ErrorString": "",
        "LastJobStarted": 1564851600,
        "LastSuccesfulJob": 1564851600
        } 
        ]
      1. Use LLD macro with backslash in Item Prototype: Full code:
        $.[?(@.ProtectionGroup=='{#PG.NAME}' && @.DataSource=='{#DS.NAME}')].first()

         

      Result:

      Error in LLD rule:

      Cannot update item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "'VM\server-815')].first()".
      Cannot update item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "'VM\server-816')].first()".

        1. image-2019-08-04-15-32-22-730.png
          image-2019-08-04-15-32-22-730.png
          10 kB
        2. image-2019-08-04-15-37-52-710.png
          image-2019-08-04-15-37-52-710.png
          12 kB
        3. image-2019-08-07-16-00-57-285.png
          image-2019-08-07-16-00-57-285.png
          17 kB
        4. image-2019-08-07-16-01-28-922.png
          image-2019-08-07-16-01-28-922.png
          9 kB
        5. image-2019-08-07-16-02-24-859.png
          image-2019-08-07-16-02-24-859.png
          43 kB
        6. image-2019-08-07-16-02-49-446.png
          image-2019-08-07-16-02-49-446.png
          18 kB
        7. image-2019-08-07-16-03-51-139.png
          image-2019-08-07-16-03-51-139.png
          35 kB
        8. image-2019-08-07-16-05-30-229.png
          image-2019-08-07-16-05-30-229.png
          12 kB
        9. items.jpg
          items.jpg
          36 kB
        10. lld.json
          0.3 kB
        11. preprocessing.jpg
          preprocessing.jpg
          54 kB
        12. screenshot-1.png
          screenshot-1.png
          49 kB
        13. screenshot-2.png
          screenshot-2.png
          32 kB
        14. screenshot-3.png
          screenshot-3.png
          65 kB
        15. screenshot-4.png
          screenshot-4.png
          37 kB
        16. screenshot-5.png
          screenshot-5.png
          47 kB
        17. test.py
          6 kB
        18. zbx_export_hosts.xml
          4 kB

            atumilovics Andrejs Tumilovics
            alex_spq Alex Alexandrov (Inactive)
            Team C
            Votes:
            4 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: