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

Elasticsearch 7.x+ deprecated mapping types. Zabbix uses "values" instead of "_doc"

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Minor Minor
    • None
    • 4.2.0
    • None

      Reference of deprecation of index type from Elasticsearch site: https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html

      Steps to reproduce:

      1. Create index template uint_template in elastic search according to note in https://www.zabbix.com/documentation/4.0/manual/appendix/install/elastic_search_setup
      2. Set Elasticsearch as zabbix backend for history

      Result:
      Zabbix index create as:

      curl -X PUT \
       http://your-elasticsearch.here:9200/_template/uint_template \-H 'content-type:application/json' \ -d '{
         "template": "uint*",
         "index_patterns": ["uint*"],
         "settings" : {
            "index" : {
               "number_of_replicas" : 1,
               "number_of_shards" : 5
            }
         },
         "mappings" : {
            "values" : {
               "properties" : {
                  "itemid" : {
                     "type" : "long"
                  },
                  "clock" : {
                     "format" : "epoch_second",
                     "type" : "date"
                  },
                  "value" : {
                     "type" : "long"
                  }
               }
            }
         }
      }'
      

      And zabbix server pushing values to Elasticsearch index with type "values"
      Expected:
      Create index with the following command ("values" changed to "_doc"):

      curl -X PUT \
       http://your-elasticsearch.here:9200/_template/uint_template \-H 'content-type:application/json' \ -d '{
         "template": "uint*",
         "index_patterns": ["uint*"],
         "settings" : {
            "index" : {
               "number_of_replicas" : 1,
               "number_of_shards" : 5
            }
         },
         "mappings" : {
            "_doc" : {
               "properties" : {
                  "itemid" : {
                     "type" : "long"
                  },
                  "clock" : {
                     "format" : "epoch_second",
                     "type" : "date"
                  },
                  "value" : {
                     "type" : "long"
                  }
               }
            }
         }
      }'
      

      And zabbix server pushing values to Elasticsearch index with type "_doc"

            ArtursL Arturs Lontons
            gelonsoft Oleg Banin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: