# Using aliases to optimize queries from a dashboard

**URL:** <https://discuss.elastic.co/t/using-aliases-to-optimize-queries-from-a-dashboard/263275>\
**Category:** Kibana\
**Created:** [February 4, 2021, 5:52pm UTC](https://discuss.elastic.co/t/using-aliases-to-optimize-queries-from-a-dashboard/263275 "2021-02-04T17:52:12Z")\
**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 4, 2021, 5:52pm UTC](https://discuss.elastic.co/t/using-aliases-to-optimize-queries-from-a-dashboard/263275/1 "2021-02-04T17:52:12Z")

</div>

Good afternoon, at the moment I am consulting what is the best way to optimize the way many users consult from the dashboard. We have index\_patterns that store information for more than one year and when users filter the boards for long periods of time the cluster starts to fail.

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [February 4, 2021, 7:02pm UTC](https://discuss.elastic.co/t/using-aliases-to-optimize-queries-from-a-dashboard/263275/2 "2021-02-04T19:02:50Z")

</div>

Have you considered using rollups to rollup your data after it has reached a certain age?

---

<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 4, 2021, 7:32pm UTC](https://discuss.elastic.co/t/using-aliases-to-optimize-queries-from-a-dashboard/263275/3 "2021-02-04T19:32:24Z")

</div>

Greetings Lukas, it is a good option, however we are considering which is the best, they had told us that with an alias we could control the queries at the user level but I have not found an example of how it could be applied. That is to say that per user the history to be consulted could be limited, will it be possible?

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [February 5, 2021, 4:08pm UTC](https://discuss.elastic.co/t/using-aliases-to-optimize-queries-from-a-dashboard/263275/4 "2021-02-05T16:08:13Z")

</div>

Sure, that makes sense. If you create an alias, you can control which indices that alias points to, in order to restrict what the users will be able to query.

For example, if my indices are in the format `logs-2021-02-05`, I could create an alias, `my-logs`, that targets specific indices using the index alias APIs:

```auto
POST /_aliases
{
  "actions" : [
    { "add" : { "index" : "logs-2021-02-04", "alias" : "my-logs" } },
    { "add" : { "index" : "logs-2021-02-05", "alias" : "my-logs" } }
  ]
}

```

An alias can target any number of indices. You can also remove indices from an alias:

```auto
POST /_aliases
{
  "actions" : [
    { "remove" : { "index" : "logs-2020-02-04", "alias" : "my-logs" } }
  ]
}

```

Then, in Kibana, you can create an index pattern from the alias (in our example, `my-logs`).

Hope this helps!

---

<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 8, 2021, 9:04pm UTC](https://discuss.elastic.co/t/using-aliases-to-optimize-queries-from-a-dashboard/263275/5 "2021-02-08T21:04:53Z")

</div>

thank you very much lukas, i think i should definitely consider creating ILM policies where i can manage indices at performance, resistance and retention level.

---

<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, 6:03pm UTC](https://discuss.elastic.co/t/using-aliases-to-optimize-queries-from-a-dashboard/263275/6 "2021-02-15T18:03:17Z")

</div>

Lukas good afternoon, I have a question how I can force specific users or roles to only filter in kibana for short periods and not have a search option enabled for long periods as this slows down the cluster.

---

<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 15, 2021, 6:03pm UTC](https://discuss.elastic.co/t/using-aliases-to-optimize-queries-from-a-dashboard/263275/7 "2021-03-15T18:03:40Z")

</div>

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