Date
Filter plugin : Dateâ
- Author: InterestingLab
- Homepage: https://interestinglab.github.io/seatunnel-docs
- Version: 1.0.0
Descriptionâ
The date filter is used for parsing dates from specified field.
Optionsâ
name | type | required | default value |
---|---|---|---|
default_value | string | no | ${now} |
locale | string | no | Locale.US |
source_field | string | no | __root__ |
source_time_format | string | no | UNIX_MS |
target_field | string | no | datetime |
target_time_format | string | no | yyyy/MM/dd HH:mm:ss |
time_zone | string | no | - |
default_value [string]â
If the date conversion fails, the current time(${now}
) will be used in the specified format.
locale [string]â
Locale of source field.
source_field [string]â
Source field, if not configured, the current time will be used.
source_time_format [string]â
Source field time format, currently supports UNIX(10-bit seconds timestamp), UNIX_MS(13-bit millisecond timestamp) and SimpleDateFormat
format. The commonly used time formats are listed below:
Symbol | Description |
---|---|
y | Year |
M | Month |
d | Day of month |
H | Hour in day (0-23) |
m | Minute in hour |
s | Second in minute |
The detailed time format syntax:Java SimpleDateFormat.
target_field [string]â
Target field, default is datetime
.
target_time_format [string]â
Target field time format, The detailed time format syntax:Java SimpleDateFormat.
time_zone [string]â
Timezone of source field
Examplesâ
date {
source_field = "timestamp"
target_field = "date"
source_time_format = "UNIX"
target_time_format = "yyyy/MM/dd"
}
Convert the
timestamp
field from UNIX timestamp to theyyyy/MM/dd
format.
date {
source_field = "httpdate"
target_field = "datetime"
source_time_format = "dd/MMM/yyyy:HH:mm:ss Z"
target_time_format = "yyyy/MM/dd HH:mm:ss"
}
Convert the
httpdate
field fromdd/MMM/yyyy:HH:mm:ss Z
format to theyyyy/MM/dd HH:mm:ss
format