Relative Time Syntax

In many places in LogScale you have to specify a time interval. For example when specifying the time interval for a query or when using the timeChart() query function.

To make specifying a time more flexible, LogScale supports a relative time syntax. This lets you express a simple time duration, rather than specifying two absolute times.

You specify a relative time modifier as a number followed by a word. The following table shows which words you can use:

Time Unit Accepted Values
Milliseconds millisecond, milliseconds, millis, ms
Seconds second, seconds, s, sec, secs
Minutes minute, minutes, m, min
Hours hour, hours, h, hr, hrs
Days day, days, d
Weeks week, weeks, w
Months month, months, mon
Quarters quarter, quarters, q, qtr, qtrs
Years year, years, y, yr, yrs

You can include a space character between the number and the unit of time.

Relative Time Syntax Examples

Two hours:


Two hours:

2 hours

Three weeks:

3 weeks

Ten seconds:


Ten seconds:


Regular Expression

This regular expression describes the format:

^(\d+) ?(years?
| y
| yrs?
| quarters?
| q
| qtrs?
| months?
| mon
| weeks?
| w
| days?
| d
| hours?
| hr?
| hrs
| minutes?
| m
| min
| seconds?
| s
| secs?
| milliseconds?
| millis
| ms)$