Time filters
AKIPS uses syntax for time filters in:
- reports and graphs
- threshold, alerting and availability rules.
AKIPS defines a week as 00:00:00 on Sunday to 23:59:59 on Saturday.
| Syntax | Description | Example |
|---|---|---|
| m | minute | 7m |
| h | hour | 2h |
| d | day | 5d |
| w | week | 6w |
| M | month | 3M |
| y / yyyy | year | 1y / 2021 |
| yyyy q[1-4] | year and quarter | 2021 q2 |
| yyyy-MM | year and month | 2021-04 |
| yyyy-MM-dd | year, month and day | 2021-04-17 |
| yyyy-MM-dd hh:mm | year, month, day and time | 2021-04-17 15:30 |
Use the following syntax:
{positive integer}{m h d w M y}
{ddd} {hh:mm} to {hh:mm}
{ddd} {hh:mm} to {ddd} {hh:mm}
{ddd} to {ddd} {hh:mm} to {hh:mm}
not {ddd} {hh:mm} to {hh:mm}
not {ddd} {hh:mm} to {ddd} {hh:mm}
not {ddd} to {ddd} {hh:mm} to {hh:mm}
thishour
lasthour
today
yesterday
thisweek
lastweek
thismonth
lastmonth
thisyear
lastyear
last {duration}
from yyyy to yyyy
from yyyy-mm to yyyy-mm
from yyyy-mm-dd to yyyy-mm-dd
from yyyy-mm-dd hh:mm to yyyy-mm-dd hh:mm
from yyyy for {duration}
from yyyy-mm for {duration}
from yyyy-mm-dd for {duration}
from yyyy-mm-dd hh:mm for {duration}
from {timestamp} to {timestamp}
from {point in time} to {point in time}
from {point in time} to {point in time} [+- duration]
from {point in time} [+- duration] to
{point in time} [+- duration]
now
startoflastminute
endoflastminute
startofthisminute
endofthisminute
startoflasthour
endoflasthour
startofthishour
endofthishour
startofyesterday
endofyesterday
startoftoday
endoftoday
startoflastweek
endoflastweek
startofthisweek
endofthisweek
startoflastmonth
endoflastmonth
startofthismonth
endofthismonth
startoflastyear
endoflastyear
startofthisyear
endofthisyear
tf pairs and tf span
The tf pairs command will display a series of start, end pairs which indicate valid time ranges within the time filter.
The human-readable form of this is shown in the tf dump command.
tf dump "lastweek; mon to fri 8:00 to 17:00"
tf pairs "lastweek; mon to fri 8:00 to 17:00"
The tf span command displays the total span of the time filter.
tf dump "lastweek; mon to fri 8:00 to 17:00"
tf span "lastweek; mon to fri 8:00 to 17:00"
Examples
The past 30 minutes:
tf dump last30m
span 2021-03-06 09:20:50 to 2021-03-06 09:50:50
The past 24 hours:
tf dump last24h
span 2021-03-05 10:05:56 to 2021-03-06 10:05:56
The previous day (until midnight this morning):
tf dump last1d
span 2021-03-06 00:00:00 to 2021-03-06 23:59:59
The previous seven days (until midnight this morning):
tf dump last7d
span 2021-02-28 00:00:00 to 2021-03-06 23:59:59
During business hours for the past week:
tf dump "lastweek; mon to fri 8:00 to 17:00"
span 2021-02-24 00:00:00 to 2021-03-02 23:59:59
include 2021-02-25 08:00:00 to 2021-02-25 17:00:00
include 2021-02-26 08:00:00 to 2021-02-26 17:00:00
include 2021-02-27 08:00:00 to 2021-02-27 17:00:00
include 2021-02-28 08:00:00 to 2021-02-28 17:00:00
include 2021-03-01 08:00:00 to 2021-03-01 17:00:00
During trading hours (with Thursday-evening trading) for the past week:
tf dump "lastweek; mon to fri 8:00 to 17:00; thu 8:00 to 21:00"
span 2021-02-24 00:00:00 to 2021-03-02 23:59:59
include 2021-02-25 08:00:00 to 2021-02-25 17:00:00
include 2021-02-26 08:00:00 to 2021-02-26 17:00:00
include 2021-02-27 08:00:00 to 2021-02-27 17:00:00
include 2021-02-28 08:00:00 to 2021-02-28 21:00:00
include 2021-03-01 08:00:00 to 2021-03-01 17:00:00
Outside trading hours (with Saturday-morning trading) for the past week:
tf dump "lastweek; not mon to fri 8:00 to 17:00; not sat 8:00 to 12:00"
span 2021-02-24 00:00:00 to 2021-03-02 23:59:59
include 2021-02-24 00:00:00 to 2021-02-25 08:00:00
include 2021-02-25 17:00:00 to 2021-02-26 08:00:00
include 2021-02-26 17:00:00 to 2021-02-27 08:00:00
include 2021-02-27 17:00:00 to 2021-02-28 08:00:00
include 2021-02-28 17:00:00 to 2021-03-01 08:00:00
include 2021-03-01 17:00:00 to 2021-03-02 08:00:00
include 2021-03-02 12:00:00 to 2021-03-02 23:59:59
During business hours in the first quarter of 2021:
tf dump "2021 q1; mon to fri 8:00 to 17:00"
span 2021-01-01 00:00:00 to 2021-03-31 23:59:59
include 2021-01-01 08:00:00 to 2021-01-01 17:00:00
include 2021-01-02 08:00:00 to 2021-01-02 17:00:00
include 2021-01-03 08:00:00 to 2021-01-03 17:00:00
...
include 2021-03-28 08:00:00 to 2021-03-28 17:00:00
include 2021-03-29 08:00:00 to 2021-03-29 17:00:00
The past 30 minutes:
tf dump "from now - 1h to now - 30m"
span 2021-03-06 09:30:58 to 2021-03-06 10:00:58
Today until now:
tf dump "from startoftoday to now"
span 2021-03-06 00:00:00 to 2021-03-06 10:33:13
Business hours on 1 February 2021:
tf dump "2021-02-01 8:00 to 17:00"
span 2021-02-01 08:00:00 to 2021-02-01 17:00:00
After business hours on 1 February 2021:
tf dump "from 2021-02-01 18:00 to 2021-02-02 06:00"
span 2021-02-01 18:00:00 to 2021-02-02 06:00:00
The first two months of 2021:
tf dump "from 2021 for 2M"
span 2021-01-01 00:00:00 to 2021-03-01 00:00:00
Yesterday from midday for three hours:
tf dump "from startofyesterday + 12h to startofyesterday + 15h"
span 2021-03-05 12:00:00 to 2021-03-05 15:00:00
tf check
The tf check command will display either 1 (true) or 0 (false) depending on whether the given point in time (Unix epoch time) is within the time filter.
Use the following syntax:
tf check {point in time} "{time filter}"
Examples
tf check 1594771234 "from 2020-07-05 to 2020-07-11"
0
tf check 1594771234 "from 2020-07-12 to 2020-07-18"
1