Mark_S
(Baldrick)
March 17, 2023, 3:24pm
1
When creating an Index Template, I get this error:
Error when creating Template: composable template template after composition is invalid
I observe that:
This error occurs only when I use the normal index template. If I use the Legacy Template then it is created without any problems
If I completely remove the mappings, then the template is created ok. (but later on I still cannot add the mapping)
Here the mapping:
{
"mappings": {
"properties": {
"@version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"@timestamp": {
"type": "date"
},
"application_server": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"application_server2": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"application_server3": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
leandrojmp
(Leandro Pereira)
March 17, 2023, 6:27pm
2
What is the endpoint you are using? Can you share the entire template, not just the mappings?
Mark_S
(Baldrick)
March 18, 2023, 5:12pm
3
When using the UI to create the template I got the error.
However it seems ok to create it with PUT (!)
PUT _index_template/test_template
{
"template": {
"settings": {
"index": {
"lifecycle": {
"name": "Testindexpolicy",
"rollover_alias": "index_from_logstash_test_alias"
},
"number_of_replicas": "0"
}
},
"mappings": {
"properties": {
"@version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"@timestamp": {
"type": "date"
},
"app_server": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"app_server2": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"aliases": {
"test-search-all": {}
}
},
"index_patterns": [
"index_from_logstash_test_alias*"
]
}
jba
(Jan Bruun Andersen)
March 18, 2023, 5:38pm
4
Somewhere near the end of the (Kibana) UI for creating a new (composable) template there should be an option to view the resulting JSON data.
Does this result differ from the template that you can deploy using the Console (PUT _index_template/xxxxxx
)?
Have you tried the PUT _index_template/_simulate/xxxxxx
thingy to see what that tells you?
Mark_S
(Baldrick)
March 18, 2023, 5:59pm
5
Good idea, but when I used the UI, as soon as I pasted the mapping the JSON would not be generated and I would just see the error message.
So what I did is this: I created the template with a simple mapping, and then got the JSON and replaced the mapping, and used PUT.
system
(system)
Closed
April 15, 2023, 5:59pm
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.