How to create a custom time range for Last Month in kibana

Hi all,
I am trying to make a custom time range to be added in the 'Quick' section of time range in kibana.
I want to make a quick time range field called 'Last Month'.

This is the expression that I added in the advance setting>> Time picker quick ranges.

{

"from": "now/M-1M",

"to": "now/M-1M",

"display": "Last Month (Custom)",

"section": 1

},

This shows the date ranges from:
1st January 00.00 to 28th Jan 23.59.
How can I show the date ranges from 1st jan 00.00 to 31st Jan 23.59 ( or from the first date of the last month to the last date of the last month.) ?

1 Like

Hello,
Can you try with the following one?
{

"from": "now/M-1",

"to": "now/M-1",

"display": "Last Month (Custom)",

"section": 1

}

Hello Marius,

Thanks for your response!

I tried the solution given by you. It didn't work. But after tweaking it a bit, I finally arrived at the solution, and it did work. It is:

{

"from": "now/M-1M",

"to": "now-1M/M",

"display": "Last Month (Custom)",

"section": 1

}

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