Hi
I have a problem when I create a new template.
As I wrote in the previous post I must create a simple template whit a different tokenizer because the standard one delete some character that I need.
so I create this one:
{
"template": "apache_access-*",
"order": 1,
"settings": {
"number_of_shards": 3,
"number_of_replicas": 1
},
"analysis": {
"my_analyzer": {
"type": "custom",
"filter": "standard",
"tokenizer": "whitespace"
}
},
"mappings": {
"referer": {"type": "string"},
"request": {"type": "string"},
"auth": {"type": "string"},
"sslClient": {"type": "string"},
"type": {"type": "string"},
"path": {"type": "string"},
"pathFolder": {"type": "string"},
"sslProt": {"type": "string"},
"httpVersion": {"type": "string"},
"bSent": {"type": "long"},
"clientIP": {"type": "string"},
"@version": {"type": "string"},
"host": {"type": "string"},
"connection": {"type": "string"},
"uniqueID": {"type": "string"},
"timestamp": {"type": "string"},
"chiper": {"type": "string"},
"keepAlive": {"type": "long"},
"query": {"type": "string"},
"@timestamp": {
"format": "strict_date_optional_time||epoch_millis",
"type": "date"
},
"response": {"type": "long"},
"header": {"type": "string"},
"rBytes": {"type": "long"},
"bReceived": {"type": "long"},
"status": {"type": "string"}
}
}
Elasticsearch accept this template but when I try to check it using the command
-XGET localhost:9200/_template/?pretty=true
I receive back this error
{
"error" : {
"root_cause" : [ {
"type" : "class_cast_exception",
"reason" : "java.lang.String cannot be cast to java.util.Map"
} ],
"type" : "class_cast_exception",
"reason" : "java.lang.String cannot be cast to java.util.Map"
},
"status" : 500
}
When I remove it
curl -XDELETE localhost:9200/_template/apache
The _template command works again
Maybe, like always is a stupid question but i can't understand why this happen!