Skip to content

Instantly share code, notes, and snippets.

@dakrone
Created August 12, 2021 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dakrone/018e8c529c8e9f7e3c83cbf852e95f09 to your computer and use it in GitHub Desktop.
Save dakrone/018e8c529c8e9f7e3c83cbf852e95f09 to your computer and use it in GitHub Desktop.
PUT /_component_template/mappings
{
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
}
PUT /_component_template/empty
{
"template": {}
}
PUT /_index_template/together
{
"index_patterns": ["foo"],
"template": {
"mappings": {
"properties": {
"@other-timestamp": {
"type": "date"
}
}
},
"settings": {
"index.number_of_shards": 3,
"index.number_of_replicas": 0
}
},
"composed_of": ["mappings", "empty"]
}
PUT /foo
GET /foo
################# output
{
"foo" : {
"aliases" : { },
"mappings" : {
"properties" : {
"@other-timestamp" : {
"type" : "date"
},
"@timestamp" : {
"type" : "date"
}
}
},
"settings" : {
"index" : {
"routing" : {
"allocation" : {
"include" : {
"_tier_preference" : "data_content"
}
}
},
"number_of_shards" : "3",
"provided_name" : "foo",
"creation_date" : "1628781621962",
"number_of_replicas" : "0",
"uuid" : "ApcnEgLjSWeTvAQyBeZVZA",
"version" : {
"created" : "7130499"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment