elasticsearct puttemplate. [mapper_parsing_exception] Root mapping definition has unsupported parameters

121 views Asked by At

Make template base on https://github.com/vanthome/winston-elasticsearch/blob/master/index-template-mapping.json

 {
      "index_patterns": ["applogs-*"],
      "settings": {
        "number_of_shards": 1

      },
      "mappings": {
        "_source": { "enabled": true },
        "properties": {
          "@timestamp": { "type": "date" },
          "@version": { "type": "keyword" },
          "message": { "type": "text", "index": true },
          "severity": { "type": "keyword", "index": true },
          "geohash":{ "type": "geo-point", "index": true},
          "location":{ "type": "geo-point", "index": true},
        }
      }
    }

but get an error

[mapper_parsing_exception] Root mapping definition has unsupported parameters:  [severity : {index=true, type=keyword}] [@timestamp : {type=date}] [@version : {type=keyword}] [message : {index=true, type=text}] [fields : {dynamic=true, properties={}}]

probably some obsolete version? What I should update?

1

There are 1 answers

0
Joe - Check out my books On

Based on the docs:

PUT _template/template_1
{
  "index_patterns": [
    "applogs-*"
  ],
  "settings": {
    "number_of_shards": 1
  },
  "mappings": {
    "_source": {
      "enabled": true
    },
    "properties": {
      "@timestamp": {
        "type": "date"
      },
      "@version": {
        "type": "keyword"
      },
      "message": {
        "type": "text",
        "index": true
      },
      "severity": {
        "type": "keyword",
        "index": true
      },
      "geohash": {
        "type": "geo_point",
        "index": true
      },
      "location": {
        "type": "geo_point",
        "index": true
      }
    }
  }
}

Your json was invalid (one comma too much) and also geo-point --> geo_point.