The result keys of CTrend::getFromElasticsearch are differ from CTrend::getFromSql

XMLWordPrintable

    • Type: Incident report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 4.2.4
    • Component/s: Frontend (F)
    • None

       

      Mysql result set is:

      Array
      (
      [0] => Array
      (
      [itemid] => 43081
      [clock] => 1563742800
      [num] => 60
      [value_min] => 1.1575
      [value_avg] => 5.9419
      [value_max] => 14.7072
      )
      
      [1] => Array
      (
      [itemid] => 43081
      [clock] => 1563746400
      [num] => 60
      [value_min] => 2.0631
      [value_avg] => 4.2845
      [value_max] => 13.9891
      )
      
      
      

       but elasticsearch result is:

      // Array
      (
      [0] => Array
      (
      [itemid] => 43081
      [clock] => 1563742800
      [num] => 60
      [min_value] => 1.1575
      [avg_value] => 5.9419
      [max_value] => 14.7072
      )
      ...
      [1] => Array
      (
      [itemid] => 43081
      [clock] => 1563746400
      [num] => 60
      [min_value] => 2.0631
      [avg_value] => 4.2845
      [max_value] => 13.9891
      )
      
      
      

      https://github.com/zabbix/zabbix/blob/master/frontends/php/include/classes/api/services/CTrend.php#L298

       

      Fast fix min_value -> value_min solves the issue.

      'value_min' => $histogram['min_value']['value'],
      'value_avg' => $histogram['avg_value']['value'],
      'value_max' => $histogram['max_value']['value']
      
      

            Assignee:
            Zabbix Development Team
            Reporter:
            Sergey Ignatov
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: