Old release template.log file can't work in release 6.0.0


#1

we had used to elasticsearch 2.1and logstasth 2.1 release.

Today we installed elasticsearch 6.0.0 and logstash 6.0.0. then we migrated old release logstash
configration file to new platform. But after migration we got errors below.

Do you have any idea what is wrong about our template.json file ? Regards

Elastic Logs:
[2017-10-20T11:48:56,738][DEBUG][o.e.a.a.i.t.p.TransportPutIndexTemplateAction] [btelastic01] failed to put template [logstash]
org.elasticsearch.index.mapper.MapperParsingException: Failed to parse mapping [default]: No handler for type [string] declared on field [@version]
Caused by: org.elasticsearch.index.mapper.MapperParsingException: No handler for type [string] declared on field [@version]
[2017-10-20T11:48:56,999][DEBUG][o.e.a.a.i.t.p.TransportPutIndexTemplateAction] [btelastic01] failed to put template [logstash]
org.elasticsearch.index.mapper.MapperParsingException: Failed to parse mapping [default]: No handler for type [string] declared on field [@version]

Logstash Log:
[2017-10-20T11:48:46,457][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2017-10-20T11:48:54,721][INFO ][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://10.2.1.148:9200/]}}
[2017-10-20T11:48:54,734][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://10.2.1.148:9200/, :path=>"/"}
[2017-10-20T11:48:55,209][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>"http://10.2.1.148:9200/"}
[2017-10-20T11:48:55,219][INFO ][logstash.outputs.elasticsearch] Using mapping template from {:path=>"/etc/logstash/templates/template.json"}
[2017-10-20T11:48:55,425][INFO ][logstash.outputs.elasticsearch] Attempting to install template {:manage_template=>{"template"=>"", "settings"=>{"index.refresh_interval"=>"60s"}, "mappings"=>{"default"=>{"_all"=>{"enabled"=>true, "omit_norms"=>true}, "dynamic_templates"=>[{"message_field"=>{"match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"string", "index"=>"analyzed", "omit_norms"=>true}}}, {"string_fields"=>{"match"=>"", "match_mapping_type"=>"string", "mapping"=>{"type"=>"string", "index"=>"analyzed", "omit_norms"=>true, "fields"=>{"raw"=>{"type"=>"string", "index"=>"not_analyzed", "ignore_above"=>256}}}}}], "properties"=>{"@version"=>{"type"=>"string", "index"=>"not_analyzed"}, "geo_point"=>{"type"=>"geo_point"}}}}}}
[2017-10-20T11:48:55,445][INFO ][logstash.outputs.elasticsearch] Installing elasticsearch template to _template/logstash
[2017-10-20T11:48:55,548][ERROR][logstash.outputs.elasticsearch] Failed to install template. {:message=>"Got response code '400' contacting Elasticsearch at URL 'http://10.2.1.148:9200/_template/logstash'", :class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb:80:in perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:269:inperform_request_to_url'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:257:in block in perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:347:inwith_connection'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:256:in perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:264:inblock in put'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/http_client.rb:339:in template_put'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/http_client.rb:82:intemplate_install'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/template_manager.rb:29:in install'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/template_manager.rb:9:ininstall_template'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/common.rb:52:in install_template'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-8.1.1-java/lib/logstash/outputs/elasticsearch/common.rb:25:inregister'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:9:in register'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:43:inregister'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:388:in register_plugin'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:399:inblock in register_plugins'", "org/jruby/RubyArray.java:1734:in each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:399:inregister_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:804:in maybe_setup_out_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:409:instart_workers'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:333:in run'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:293:inblock in start'"]}
[2017-10-20T11:48:55,551][INFO ][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["//10.2.1.148:9200"]}

Template Json:
{
"template": "",
"settings": {
"index.refresh_interval": "60s"
},
"mappings": {
"default": {
"_all": {"enabled": true, "omit_norms": true},
"dynamic_templates": [ {
"message_field": {
"match": "message",
"match_mapping_type": "string",
"mapping": {
"type": "string", "index": "analyzed", "omit_norms": true
}
}
}, {
"string_fields": {
"match": "
",
"match_mapping_type": "string",
"mapping": {
"type": "string", "index": "analyzed", "omit_norms": true,
"fields": {
"raw": {"type": "string", "index": "not_analyzed", "ignore_above": 256}
}
}
}
} ],
"properties": {
"@version": { "type": "string", "index": "not_analyzed" },
"geo_point": { "type": "geo_point" }
}
}
}
}


#2

After trying to fix template.json problem for a while, i decided to use elasticsearch 5.6.0 release.
my template.json file is working properly in 5.6.0 release.


(system) #3

This topic was automatically closed after 21 days. New replies are no longer allowed.