# Update Aliases API

**URL:** <https://discuss.elastic.co/t/update-aliases-api/264369>\
**Category:** Elasticsearch\
**Created:** [February 15, 2021, 11:57pm UTC](https://discuss.elastic.co/t/update-aliases-api/264369 "2021-02-15T23:57:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oscar\_Lopez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oscar_lopez/32/81334_2.png) [@Oscar\_Lopez](https://discuss.elastic.co/u/Oscar_Lopez)\
**Post date:** [February 15, 2021, 11:57pm UTC](https://discuss.elastic.co/t/update-aliases-api/264369/1 "2021-02-15T23:57:38Z")

</div>

I have an index\_pattern called metricbeat- \* which I create an alias called alias\_metricbeat. Through the elasticsearch API I want to condition so that certain users do not perform filters of more than three months in the boards, someone can tell me how I can do it, thank you.

My template is:

PUT \_template/demoalias  
{  
"index\_patterns" : [  
"matricbeat-\*"  
],  
"aliases": {  
"alias\_metricbeat": {}  
},  
"mappings": {},  
"settings" : {  
"index" : {  
"codec" : "best\_compression",  
"refresh\_interval" : "5s",  
"number\_of\_shards": "5",  
"number\_of\_replicas": "1",  
"lifecycle.name": "lifecycle\_metricbeat",  
"lifecycle.rollover\_alias": "lifecycle\_metricbeat\_rollover"  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 15, 2021, 11:58pm UTC](https://discuss.elastic.co/t/update-aliases-api/264369/2 "2021-02-15T23:58:27Z")

</div>

Checkout [Update index alias API | Elasticsearch Reference [7.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.11/indices-aliases.html#filtered)

---

<div class="post-metadata">

**Author:** ![Oscar\_Lopez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oscar_lopez/32/81334_2.png) [@Oscar\_Lopez](https://discuss.elastic.co/u/Oscar_Lopez)\
**Post date:** [February 16, 2021, 12:09am UTC](https://discuss.elastic.co/t/update-aliases-api/264369/3 "2021-02-16T00:09:32Z")

</div>

Cordial greetings Warkolm, in the url I see that there are some examples in my case if I want to condition several users or a specific test role, how can the query go. Thanks.

POST /\_aliases  
{  
"actions": [  
{  
"add": {  
"index": "metricbeat-\*",  
"alias": "alias\_metricbeat",  
"filter": { "term": { "?": "test" } }  
}  
}  
]  
}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 16, 2021, 12:47am UTC](https://discuss.elastic.co/t/update-aliases-api/264369/4 "2021-02-16T00:47:11Z")

</div>

I'm not sure what you mean there sorry.

---

<div class="post-metadata">

**Author:** ![Oscar\_Lopez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oscar_lopez/32/81334_2.png) [@Oscar\_Lopez](https://discuss.elastic.co/u/Oscar_Lopez)\
**Post date:** [February 16, 2021, 1:59pm UTC](https://discuss.elastic.co/t/update-aliases-api/264369/5 "2021-02-16T13:59:09Z")

</div>

Good morning Warkolm, The situation is that some users are performing very extensive time filters in the kibana boards and I want to restrict some users so that at the time of filtering they can only place the date range of the last three months of an index pattern is this possible with aliases?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 16, 2021, 9:19pm UTC](https://discuss.elastic.co/t/update-aliases-api/264369/6 "2021-02-16T21:19:56Z")

</div>

Yes, it is with a filtered alias.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 16, 2021, 9:20pm UTC](https://discuss.elastic.co/t/update-aliases-api/264369/7 "2021-03-16T21:20:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
