Kibana does not recognise dates in the same formats as most clients will be used to using. As a result, initially applying time period filters can be tricky. In this article, we will explain the various date measurements used by Kibana and provide examples of the most frequently used date periods so they can be copied and pasted to your filters when you need them.
The expression starts with an anchor date, which can either be now, or a date string ending with ||.
This anchor date can optionally be followed by one or more maths expressions:
+1h: Add one hour
-1d: Subtract one day
/d: Round down to the nearest day and so on.
The supported time units are:
y = Years
M = Months
w = Weeks
d = Days
h = Hours
H = Hours
m = Minutes
s = Seconds
Assuming now is 2001-01-01 12:00:00, some examples are:
now+1h
now in milliseconds plus one hour. Resolves to: 2001-01-01 13:00:00
now-1h
now in milliseconds minus one hour. Resolves to: 2001-01-01 11:00:00
now-1h/d
now in milliseconds minus one hour, rounded down to UTC 00:00. Resolves to: 2001-01-01 00:00:00
2001.02.01\|\|+1M/d
2001-02-01 in milliseconds plus one month. Resolves to: 2001-03-01 00:00:00
Common Usage Examples (Copy and Paste for Filter use)
Here are some example date ranges and the dates they would represent below. Assuming now date is 17/09/2019...
The Last 7 days to Present
now-7d/d to now/m
Sep 10 2019 00:00 to September 17 2019 10:00
The Last 2 weeks to Present
now-14d/d to now/m
Sep 3 2019 00:00 to Sep 17 2019
Last Month
now/M-1M to now/M-1S
Aug 1 2019 00:00 to Aug 31 2019 23:59
This Month
now/M to now
Sep 1 2019 00:00 to Sep 17 2019 10:00
Last Year
now/y-1y to now/y-1s
Jan 1 2018 00:00 to Dec 31st 2018 23:59
This Year
now/y to now
Jan 1 2019 00:00 to Sep 17
We can utilise the -1s on the month and year ranges to ensure we don't capture the 1st day of the next month or year. E.g. without -1s the date would be 01/09/2019 00:00 but with the -1s the date becomes 31/08/2019 23:59
If you require a specific date or date range and require further assistance, please email support@1clearview.com