Gets the week number within a year of a timestamp (a value from 1 to 53). The week number is as defined by ISO 8601: Weeks start on a Monday and belong to the year which contains Thursday (or, equivalently, contains the majority of the week days).

ParameterTypeRequiredDefaultDescription
asstringoptional[a]_weekOfYear The name of the output field.
field[b]stringoptional[a]@timestamp The name of the input field.
timezonestringoptional[a]  The time offset to use e.g., -01:00. If not specified, the query's offset will be used.
timezoneFieldstringoptional[a]@timezone The name of the field containing the timezone to use, if not specified the query's timezone will be used. This is ignored if the timezone parameter is passed as well. If this is not defined the timezone offset of the query will be used.

[a] Optional parameters use their default value unless explicitly set

[b] The argument name field can be omitted.

Omitted Argument Names

The argument name for field can be omitted; the following forms of this function are equivalent:

logscale
time:weekOfYear("@timestamp")

and:

logscale
time:weekOfYear(field="@timestamp")