# Calendar month log comparison?

**URL:** https://discuss.elastic.co/t/calendar-month-log-comparison/159576
**Category:** Kibana
**Created:** [December 5, 2018, 5:13pm UTC](https://discuss.elastic.co/t/calendar-month-log-comparison/159576 "2018-12-05T17:13:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jbrowe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbrowe/32/99821_2.png) [@jbrowe](https://discuss.elastic.co/u/jbrowe)
#### Post date: [December 5, 2018, 5:13pm UTC](https://discuss.elastic.co/t/calendar-month-log-comparison/159576/1 "2018-12-05T17:13:04Z")

</div>

I'm trying to accomplish a simple task. I have visualizations summarizing log activity. I can change the time period using the Kibana time picker in the top right. I can get the current month summary using the absolute first-day-of-the-month date, or past 30 days, or whatever. That all works fine.

What I need now is a dashboard comparing the current activity summary to the activity from the previous calendar month. So, on Dec 4th, say, I would like to have two separate visualizations on one dashboard: the first is a log activity summary from 1 Nov to 30 Nov, and the second is 1 Dec to 4 Dec. This is easy to do manually each month. What I'd like to have, however is a visualization that rolls over every month automatically. So, in January, the previous example the first visualization would switch to 1 Dec to 31 Dec. The time-picker "Month to Date" works for the second case, but I don't know how to specify "Last Calendar Month" without using absolute dates.

---

<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: [December 5, 2018, 7:35pm UTC](https://discuss.elastic.co/t/calendar-month-log-comparison/159576/2 "2018-12-05T19:35:16Z")

</div>

Hello,

You should be able to provide a date filter when you create the visualization. To specify the last month, I believe you should be able to use: `now/M-1M` for the start of your range and `now/M` for the end of it. Provided you've enabled auto-refresh, that should give you what you need whenever you pull up the visualization.

Here are a few good links to help you out:

- [https://www.elastic.co/guide/en/kibana/current/autorefresh.html](https://www.elastic.co/guide/en/kibana/current/autorefresh.html)

- [https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math](https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math)

- [Several date math questions](https://discuss.elastic.co/t/several-date-math-questions/27453/5) (the range formats used here are useful)

Also, here's a quick screenshot of adding (editing in my case) a filter to your visualization in case you haven't tried this before:

 ![Screenshot%20from%202018-12-05%2012-27-40](https://us1.discourse-cdn.com/elastic/original/3X/f/a/fa17b8adc249c04e3f63e31211335f1349e5c295.png)

Regards,  
Aaron

---

<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: [January 2, 2019, 7:35pm UTC](https://discuss.elastic.co/t/calendar-month-log-comparison/159576/3 "2019-01-02T19:35:27Z")

</div>

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