Hi, Every body, I want to implement an automatic alias based on the field when the index is created.
This is a index template setting configuartion;
{
"order": 5,
"version": 60001,
"index_patterns": [
"debug*"
],
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "1s"
}
},
"mappings": {
"doc": {
"properties": {
"logLevel": {
"type": "keyword"
},
"hostname": {
"type": "keyword"
},
"application": {
"type": "keyword"
}
}
}
},
"aliases": {
"{application}-alias-for-{env}": {
"format": {
"env": {
"lang": "expression",
"script": "doc['logLevel'].value"
},
"application": {
"lang": "expression",
"script": "doc['application'].value"
}
}
}
}
}