ERROR][logstash.outputs.elasticsearch] Failed to install template. {:message=>"Unexpected character ('<' (code 60))

Hi,

In elastic 5.2.2 and localhost the attach .conf and .json srcipts tun ok But in elastic cloud trial 5.3 Don't work
Any suggestion

Thanks
Luis

Logstash

output {
elasticsearch {
user => "elastic"
password => "iqY4P"
action => "index"
hosts => "cloudelastic"
index => "biotagro"
workers => 1
template => "/home/luis/ELKtesting/geo_es_template1.json"
document_type => "ubicacion"
}
stdout {}
}

geo_es_template1.json

{
"template": "biot*",
"order": 1,
"settings": {
"number_of_shards": 1
},
"mappings": {
"ubicacion" : {
"properties" : {
"location" : {"type": "geo_point"}
}
}
}
}

Please encapsulate your code pastes between triple back ticks, like this:

```
CODE or MONOSPACE CONFIG ITEMS HERE
```

We can't properly read what's going on if it isn't formatted with all of the indentations.

That said, I can't see your whole template here, so I can't say what's going on with '<' (code 60), or anything else. Please paste the entire error (which should include line numbers), and fix the code pastes as described.

Hi Aaron,
Thanks for your kind answer.

I am using the same scripts for both versions without changes, until yesterday run fine over version 5.3 cloud but today not, is only to create a geo_point field named location.

Could be a security restriction on the cloud server ?

That is a full response :

ending Logstash's logs to /home/luis/Descargas/logstash-5.2.2/logs which is now configured via log4j2.properties
[2017-04-11T14:41:17,048][INFO ][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://elastic:xxxxxx@b1bae1c770ab4772a7e77e4e5079905d.us-east-1.aws.found.io:9200/]}}
[2017-04-11T14:41:17,052][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elastic:xxxxxx@b1bae1c770ab4772a7e77e4e5079905d.us-east-1.aws.found.io:9200/, :path=>"/"}
[2017-04-11T14:41:18,658][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>#<URI::HTTP:0x223814d5 URL:http://elastic:xxxxxx@b1bae1c770ab4772a7e77e4e5079905d.us-east-1.aws.found.io:9200/>}
[2017-04-11T14:41:18,659][INFO ][logstash.outputs.elasticsearch] Using mapping template from {:path=>"/home/luis/ELKtesting/geo_es_template1.json"}
[2017-04-11T14:41:20,368][ERROR][logstash.outputs.elasticsearch] Failed to install template. {:message=>"Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: [B@1744538d; line: 1, column: 2]", :class=>"LogStash::Json::ParserError", :backtrace=>["/home/luis/Descargas/logstash-5.2.2/logstash-core/lib/logstash/json.rb:41:in jruby_load'", "/home/luis/Descargas/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-6.2.6-java/lib/logstash/outputs/elasticsearch/http_client.rb:84:inget_version'", "/home/luis/Descargas/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-6.2.6-java/lib/logstash/outputs/elasticsearch/template_manager.rb:16:in get_es_version'", "/home/luis/Descargas/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-6.2.6-java/lib/logstash/outputs/elasticsearch/template_manager.rb:20:inget_es_major_version'", "/home/luis/Descargas/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-6.2.6-java/lib/logstash/outputs/elasticsearch/template_manager.rb:7:in install_template'", "/home/luis/Descargas/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-6.2.6-java/lib/logstash/outputs/elasticsearch/common.rb:54:ininstall_template'", "/home/luis/Descargas/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-6.2.6-java/lib/logstash/outputs/elasticsearch/common.rb:21:in register'", "/home/luis/Descargas/logstash-5.2.2/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:8:inregister'", "/home/luis/Descargas/logstash-5.2.2/logstash-core/lib/logstash/output_delegator.rb:37:in register'", "/home/luis/Descargas/logstash-5.2.2/logstash-core/lib/logstash/pipeline.rb:282:inregister_plugin'", "/home/luis/Descargas/logstash-5.2.2/logstash-core/lib/logstash/pipeline.rb:293:in register_plugins'", "org/jruby/RubyArray.java:1613:ineach'", "/home/luis/Descargas/logstash-5.2.2/logstash-core/lib/logstash/pipeline.rb:293:in register_plugins'", "/home/luis/Descargas/logstash-5.2.2/logstash-core/lib/logstash/pipeline.rb:302:instart_workers'", "/home/luis/Descargas/logstash-5.2.2/logstash-core/lib/logstash/pipeline.rb:232:in run'", "/home/luis/Descargas/logstash-5.2.2/logstash-core/lib/logstash/agent.rb:387:instart_pipeline'"]}
[2017-04-11T14:41:20,371][INFO ][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>[#<URI::Generic:0x6180cff7 URL://b1bae1c770ab4772a7e77e4e5079905d.us-east-1.aws.found.io>]}

input {
  file {
    path => "/home/luis/ELKtesting/Diario_cloud.txt"
    start_position => "beginning" 
    sincedb_path => "/home/luis/ELKtesting/controlcloud.txt"
    }
}

filter {
  csv {
      separator => ";"
      columns => ["Fecha","EmaID","EMA","ema2","Comuna", "Latitud","Longitud","Altura","Region","TempSuperficie","HumRel",
                  "TempAire","FechaAlt","Precipitacion","RadSolar","PresionAtm","TempAireMin","VelViento","DirViento","TempAireMax"]
  }
   
  date {
   match => ["Fecha","yyy-MM-dd HH:mm:ss","dd/MM/yyyy HH:mm","MM/dd/yy HH:mm","ISO8601"]
   locale => "en"
   timezone => "America/Santiago"
   target => "@timestamp" 
  }
   
  mutate {
      convert => {
        'TempAire' => 'float'
        'Precipitacion' => 'float'
        'HumRel' => 'float'
        'PresionAtm' => 'float'
        'RadSolar' => 'float'
        'VelViento' => 'float'
        'TempAireMin' => 'float'
        'TempAireMax' => 'float'
	'DirViento' => 'float'        
        'TempSuperficie' => 'float'        
        'Latitud' => 'float'
        'Longitud' => 'float'
        }
   }
   mutate {
          rename => {
              "Longitud" => "[location][lon]"
              "Latitud" => "[location][lat]"
          }
   }               
} 


output {
     elasticsearch {
           user => "elastic"
           password => "iqY4P"
           action => "index"
           hosts => "cloudelastic"
           index => "biotagro"
           workers => 1
           template => "/home/luis/ELKtesting/geo_es_template1.json"
           document_type => "ubicacion"
     }
    stdout {}
}

next my geo_es_template1.json

{
  "template": "biot*",
   "order": 1,
   "settings": {
    "number_of_shards": 1
    },
   "mappings": {
          "ubicacion" : {
                 "properties" : {
                       "location" : {"type": "geo_point"}
                  }
          }
    }
}

I hope you are fine, I can not still solve that , do you have any news ?
Thanks,
Regards.

I would follow the instructions in this blog post about using Logstash to create a mapping template. I'm confident it will help you fix this.

Aaron,

I got it, was a security problem, but the error message did't specify that,
Thanks a lot, anyway
Regards
Luis

Hi Aaron,

I ma getting the same issue. Can I ask what the security issue was, I may have the same issue!

Thanks

Glyn

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.