Simulate an index
Generally available; Added in 7.9.0
Get the index configuration that would be applied to the specified index from an existing index template.
Required authorization
- Cluster privileges:
manage_index_templates
Path parameters
-
name
string Required Name of the index to simulate
Query parameters
-
create
boolean Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
-
cause
string User defined reason for dry-run creating the new template for simulation purposes
-
master_timeout
string Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
Values are
-1
or0
. -
include_defaults
boolean If true, returns all relevant default configurations for the index template.
POST
/_index_template/_simulate_index/{name}
Console
POST /_index_template/_simulate_index/my-index-000001
resp = client.indices.simulate_index_template(
name="my-index-000001",
)
const response = await client.indices.simulateIndexTemplate({
name: "my-index-000001",
});
response = client.indices.simulate_index_template(
name: "my-index-000001"
)
$resp = $client->indices()->simulateIndexTemplate([
"name" => "my-index-000001",
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_index_template/_simulate_index/my-index-000001"
Response examples (200)
A successful response from `POST /_index_template/_simulate_index/my-index-000001`.
{
"template" : {
"settings" : {
"index" : {
"number_of_shards" : "2",
"number_of_replicas" : "0",
"routing" : {
"allocation" : {
"include" : {
"_tier_preference" : "data_content"
}
}
}
}
},
"mappings" : {
"properties" : {
"@timestamp" : {
"type" : "date"
}
}
},
"aliases" : { }
},
"overlapping" : [
{
"name" : "template_1",
"index_patterns" : [
"my-index-*"
]
}
]
}