Apache nifi NiFI:无法在JSON内将unix时间戳转换为日期
我有一个类似的JSON:Apache nifi NiFI:无法在JSON内将unix时间戳转换为日期,apache-nifi,Apache Nifi,我有一个类似的JSON: [ { "timestamp_from" : 1619426381, "timestamp_to" : 1619512780, "group_id" : "48427976" }, { "timestamp_from" : 1619339981, "timestamp_to" : 1619426380, "commen
[ {
"timestamp_from" : 1619426381,
"timestamp_to" : 1619512780,
"group_id" : "48427976"
}, {
"timestamp_from" : 1619339981,
"timestamp_to" : 1619426380,
"comments" : 49,
"copies" : 4,
"hidden" : 68,
"likes" : 233,
"subscribed" : 225,
"unsubscribed" : 29,
"group_id" : "48427976"
}, {
"timestamp_from" : 1619253581,
"timestamp_to" : 1619339980,
"comments" : 72,
"copies" : 7,
"hidden" : 87,
"likes" : 236,
"subscribed" : 232,
"unsubscribed" : 19,
"group_id" : "48427976"
}]
我想将timestamp
字段转换为yyyy-MM-dd
格式的日期。我尝试将UpdateRecord
用于:
-/timestamp_from${field.value:append('000'):format('yyyy-MM-dd')}
无法使用模式[“timestamp_from:”INT“,”timestamp_to:”INT“,”group_id:”STRING“,”comments:”INT“,”copies:”INT“,”hidden:”INT“,”likes:”INT“,”订阅“:”INT“,”取消订阅“:”INT”]由于java.lang.NumberFormatException,因此作为JSON对象:对于输入字符串:“2021-04-26”:对于输入字符串:“2021-04-26”
-相同错误${field.value:toString():append('000'):format('yyyy-MM-dd')}
“
包装时间戳值,它会工作。但是JSON没有整数引号。如何修复它