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

            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: