I just upgraded the elasticsearch from 2.0 to 2.3.1
It is strange that the templates I used to use were working in 2.0, but not working in 2.3.1
The same logstash instance I was using to inject the same docs, but the docs are using the template I defined.
This is my template definition
curl -XPUT 'http://staging-elkstack:9200/_template/elkstats_template' -d '
{
"order" : 2,
"template": "template_test*",
"settings": {
"number_of_shards" : 8,
"number_of_replicas" : 0
},
"mappings" : {
"log" : {
"_all" : {"enabled" : false, "omit_norms" : true},
"dynamic_templates" : [ {
"message_field" : {
"match" : "message",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string", "index" : "not_analyzed", "omit_norms" : true
}
}
}, {
"string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string", "index" : "not_analyzed", "omit_norms" : true
}
}
}
],
"properties" : {
"@timestamp": { "type": "date", "doc_values" : true },
"@version": { "type": "string", "index": "not_analyzed", "doc_values" : true },
"geopoint": {
"type": "geo_point"
}
}
}
}
}
'
This is my logstash .conf file output part
input{stdin{}}
filter {
json { source => "message" }
}
output {
stdout { codec => rubydebug }
elasticsearch {
hosts => "staging-elkstack:9200"
index => "template_test"
template_name => "elkstats_template"
}
}
To test the logstash conf, you can use this input
{ "longitude":-73.758, "latitude":41.0291}