# Dashboard which automatically selects today's index

**URL:** https://discuss.elastic.co/t/dashboard-which-automatically-selects-todays-index/338142
**Category:** Kibana
**Created:** [July 11, 2023, 4:46pm UTC](https://discuss.elastic.co/t/dashboard-which-automatically-selects-todays-index/338142 "2023-07-11T16:46:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Sam\_Estes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_estes/32/121805_2.png) [@Sam\_Estes](https://discuss.elastic.co/u/Sam_Estes)
#### Post date: [July 11, 2023, 4:46pm UTC](https://discuss.elastic.co/t/dashboard-which-automatically-selects-todays-index/338142/1 "2023-07-11T16:46:50Z")

</div>

Hello,  
I have a database with an index for each day. I would like to create a dashboard with visualizations using data from today's index. Each day, we create a new index so I would like the dashboard to automatically update to display the current (and most recent) day's worth of data. Is there a way I can easily do this? I think something along the lines of using date math in the index name for the visualization might be what I need but I haven't been able to get it to work. For reference, I was looking [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/date-math-index-names.html)  
for ideas on date math.

Any ideas? Thanks!

---

<div class="post-metadata">

### Author: ![Sam\_Estes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_estes/32/121805_2.png) [@Sam\_Estes](https://discuss.elastic.co/u/Sam_Estes)
#### Post date: [July 11, 2023, 4:48pm UTC](https://discuss.elastic.co/t/dashboard-which-automatically-selects-todays-index/338142/2 "2023-07-11T16:48:10Z")

</div>

And sorry to make this even more confusing, but I have one more request. Could I have solutions using both the current versions of ES/Kibana (8.8 I think) and version 5.5. We are in the process of updating our cluster but right now we use the 5.5 version so it would be nice to have a solution we can implement now and one for when we upgrade.

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [July 12, 2023, 10:35pm UTC](https://discuss.elastic.co/t/dashboard-which-automatically-selects-todays-index/338142/3 "2023-07-12T22:35:39Z")

</div>

> [@Sam\_Estes](#):
>
> Each day, we create a new index so I would like the dashboard to automatically update to display the current (and most recent) day's worth of data.

You can have a [dashboard-level filter](https://www.elastic.co/guide/en/kibana/current/kibana-concepts-analysts.html#autocomplete-suggestions) that limits the data to today's timerange.

It's also possible to create an [index alias with a filter](https://www.elastic.co/guide/en/elasticsearch/reference/current/aliases.html#filter-alias) that limits access to only today's data.

The date math you need can be given to Elasticsearch as an expression. For example, to filter for data with a timestamp newer than last midnight, the expression is roughly: `"@timestamp": { "gte": "now/d" }` within a `range` filter. In Kibana, your dashboard filter configuration could look like:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/e/4ed915b9cdb379e547af11be8027ce61c3333c45.png)

---

<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: [August 9, 2023, 10:35pm UTC](https://discuss.elastic.co/t/dashboard-which-automatically-selects-todays-index/338142/4 "2023-08-09T22:35:50Z")

</div>

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