V1 - Search Timeframe Selection
Search 'time' parameter
To search within a specific time window, uses the following syntax:
search {from="", to=""}
Note: 'to=' option can be omitted, for a search up to the present time
Relative timeframe
(< | > or @) (s | m | h | d | w | mon) (+|-)
- <d+1h: to last day boundary then add one hour
- >d+1h: to next day boundary then add one hour
- -5d<d or -5d@d: five day ago, then align to begin of day
Absolute timeframe
- RFC3339
2006-01-02T15:04:05Z
OR2006-01-02T15:04:05+04:00
- Local time:
2006-01-02T15:04:05
OR20220102
OR20220102_102030
Note: if no timezone specified, system timezone (UTC by default) is assumed, per site configuration.
Usage
A search for data within the past 3 days:
search {from="-3d@d", to="@d"} sContent("@tags", "fpl-example-data")
The presence of (< | > or @)
indicates a peg to the previous/next hour/day boundary. A peg to the previous boundary '<' can also be denoted by '@'.
Running a search with the following from=
option at 9:15 UTC yields:
from="-3h"
- a search from 6:15 UTC
from="-3h@h"
- a search from 6:00 UTC (at the 6:00 hour boundary)
from="-3h@d"
- a search from 0:00 UTC (of the same day, at the 0:00 day boundary)
- note that the previous day boundary is earlier than 3 hours, and the '-3h' option is in practice, ignored
from="@d+2"
- a search from 2:00 UTC (at the 2:00 hour boundary)
Examples
The follow are some commonly used time parameters:
Default
search sContent("@tags","fpl-example-data")
Note: when the time selection options are omitted entirely, the default timeframe of "last 8 hours" (
from="-8h"
) is used.
Relative timeframe
Search the previous day (yesterday)
search {from="-1d@d",to="@d"} sContent("@tags","fpl-example-data")
Search the current day (today)
search {from="<d",to=">d"} sContent("@tags","fpl-example-data")
Search last week
search {from="-1w@w",to="@w"} sContent("@tags","fpl-example-data")
Search this week
search {from="<w",to=">w"} sContent("@tags","fpl-example-data")
Search the last 48 hours
search {from="-48h"} sContent("@tags","fpl-example-data")
Absolute timeframe
Search between specific dates
search {from="20221010", to="20221013"} sContent("@tags","fpl-example-data")
A search from Oct 10th, to the 13th, on the local time day boundary
Search between specific times
search search {from="20221013_100000", to="20221015_173000"} sContent("@tags","fpl-example-data")
A search from Oct 13th 10:00, to Oct 15th 17:30, all times in the local time zone
Absolute timeframe (with time zone)
Search between specific times (UTC)
search {from="2022-10-11T05:00:00Z", to="2022-10-12T17:30:00Z"} sContent("@tags","fpl-example-data")
A search from Oct 11th 05:00, to Oct 12th 17:30, using the UTC time zone
Search between specific times (EST -4:00)
search {from="2022-10-18T15:00:00-04:00", to="2022-10-18T19:00:00-04:00"} sContent("@tags","fpl-example-data")
A search from Oct 11th 05:00, to Oct 12th 17:30, using the US Eastern (-04:00) time zone
Page last updated: 2022 Oct 18