# Time Filter for the current month

**URL:** <https://discuss.elastic.co/t/time-filter-for-the-current-month/215361>\
**Category:** Kibana\
**Created:** [January 16, 2020, 4:56pm UTC](https://discuss.elastic.co/t/time-filter-for-the-current-month/215361 "2020-01-16T16:56:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattiacareddu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattiacareddu/32/60917_2.png) [@mattiacareddu](https://discuss.elastic.co/u/mattiacareddu)\
**Post date:** [January 16, 2020, 4:56pm UTC](https://discuss.elastic.co/t/time-filter-for-the-current-month/215361/1 "2020-01-16T16:56:38Z")

</div>

I'm wondering if there is a way to filter the current visualization for the current month.  
What I need is a time range from the start of the current month month to now. I tried creating a new quick filter but I dind't find a way to calculate the first day of the current month.  
Is there a way to do that?  
Thank you.

---

<div class="post-metadata">

**Author:** ![Aaron\_Caldwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron_caldwell/32/45755_2.png) [@Aaron\_Caldwell](https://discuss.elastic.co/u/Aaron_Caldwell)\
**Post date:** [January 17, 2020, 2:41am UTC](https://discuss.elastic.co/t/time-filter-for-the-current-month/215361/2 "2020-01-17T02:41:55Z")

</div>

Hello Mattia,

Did you try the [time filter](https://www.elastic.co/guide/en/kibana/current/set-time-filter.html)? It has a filter for the last 30 days which may work for you. If you're looking for something more custom, [this solution](https://discuss.elastic.co/t/how-to-create-a-custom-time-range-for-last-month-in-kibana/166740/2) might work.

Regards,  
Aaron

---

<div class="post-metadata">

**Author:** ![mattiacareddu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattiacareddu/32/60917_2.png) [@mattiacareddu](https://discuss.elastic.co/u/mattiacareddu)\
**Post date:** [January 17, 2020, 8:25am UTC](https://discuss.elastic.co/t/time-filter-for-the-current-month/215361/3 "2020-01-17T08:25:12Z")

</div>

Hi Aaron, thanks for your reply.  
I'm alredy using the time filter but, as I said in the question, I don't need the last 30 days, I need the current month. For example I need from the first of January to now. The solution you linked doesn't work in Kibana 7.5.1. The filter show the exact string "now/M-1" instead of a calculated date.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [January 28, 2020, 12:13pm UTC](https://discuss.elastic.co/t/time-filter-for-the-current-month/215361/4 "2020-01-28T12:13:42Z")

</div>

@mattiacareddu  
This should work for "current month":  
{  
"from": "now/M",  
"to": "now",  
"display": "This month"  
},  
The first part rounds down current date to the month and the second part is just "now", so you get all the data from the start of the month until now. And I tested it on 7.5.1 so it should work.

---

<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:** [February 25, 2020, 12:16pm UTC](https://discuss.elastic.co/t/time-filter-for-the-current-month/215361/5 "2020-02-25T12:16:45Z")

</div>

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