date
The date
reducers can be used to easily extract information from existing
datetime fields such as the time
field. You'll see below how to use each one.
.year
... | reduce(year=date.year('time')) | ...
Converts a datetime
field value into the string that represents the year, such
as 2016
, 1975
, etc. Can be used both in the put and
reduce processors.
.fullmonth
... | reduce(fullmonth=date.fullmonth('time')) | ...
Converts a datetime
field value into the string that represents the full
month, such as January
, December
, etc. Can be used both in the put and
reduce processors.
.month
... | reduce(month=date.month('time')) | ...
Converts a datetime
field value into the string that represents the abreviated
month, such as Jan
, Dec
, etc. Can be used both in the put and
reduce processors.
.fullweekday
... | reduce(fullweekday=date.fullweekday('time')) | ...
Converts a datetime
field value into the string that represents the full
weekday, such as Tuesday
, Sunday
, etc. Can be used both in the
put and reduce processors.
.weekday
... | reduce(weekday=date.weekday('time')) | ...
Converts a datetime
field value into the string that represents the abreviated
weekday, such as Tue
, Sun
, etc. Can be used both in the put
and reduce processors.
.strftime
... | reduce(shortdate=date.strftime('time', '%Y/%m/%d')) | ...
Converts a datetime
field value into the format specified using python's
strftime
format from here
Can be used both in the put and reduce processors.