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

json preprocessing fails to handle newline

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • None
    • 3.4.8
    • Server (S)
    • None

      Steps to reproduce:

      • json value return by user parameter contains '\n' ( new line)
      • json preprocessing fails

      Result:

      Item preprocessing step #1 failed: cannot extract value from json by path "$.result": cannot parse as a valid JSON object: invalid control character in string data at: '
      ",
      "logging.configuration" : "file:/opt/jboss/logging.properties",
      

      Expected:

      the json should be correctly preprocessed

      Additional information: 

      • Sample Json file:
        # cat /tmp/json.txt
        {
          "number": 123,
          "key": "value",
          "new line": "\n"
        }
        
      • Works fine with jq
        # cat /tmp/json.txt|jq '.'
        {
          "number": 123,
          "key": "value",
          "new line": "\n"
        }
        

       

            Unassigned Unassigned
            khadgaray Ritesh Khadgaray
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: