Skip to main content Link Search Menu Expand Document (external link)

Timeframe Selection

Sections
  1. Search ‘time’ parameter
    1. relative time:
    2. absolute time
  2. Usage
  3. Examples
    1. Search default timeframe
    2. Search the previous day (yesterday)
    3. Search the current day (today)
    4. Search last week
    5. Search this week
    6. Search the last 48 hours

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 time:

(< | > 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 time

  • RFC3339 2006-01-02T15:04:05Z OR 2006-01-02T15:04:05+04:00
  • Local time: 2006-01-02T15:04:05 OR 20220102 OR 20220102_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:

Search default timeframe

  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.

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")

Page last updated: 2022 Sep 14