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

Preprocessing test strips leading spaces from results

XMLWordPrintable

    • Sprint candidates

      Steps to reproduce:
      1. Create any item that returns JSON string (db.odbc.get[] in my case)
      2. Add pre-processing step:
      Name: Javascript
      Parameters: return JSON.stringify(JSON.parse(value), null, 4)
      3. Run "Get Value and Test"

      Result:
      JSON is formatted but with the leading indentation stripped off.

      [
      {
      "DBEVENT_PROCESS_LOG_ID": "1",
      "PROCESS_NAME": "asdf",
      "PACKAGE_NAME": "N/A",
      ...
      

      Expected:
      JSON is formatted and includes the leading spaces..

      [
          {
              "DBEVENT_PROCESS_LOG_ID": "1",
              "PROCESS_NAME": "asdf",
              "PACKAGE_NAME": "N/A",
      ...
      

      Important: When the item values are actually collected, the leading spaces are kept. So this behaviour is just experienced when testing preprocessing.

            zabbix.dev Zabbix Development Team
            Matthew.Steeves2 Matthew Steeves
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: