Apache nifi 从json、nifi将历元转换为UTC日期

Apache nifi 从json、nifi将历元转换为UTC日期,apache-nifi,Apache Nifi,嗨,我在流文件中有以下json:{“destination.port”:“0000”,“network.packets”:“1”,“event.end”:“1563361839”,“source.address”:“1.2.2.1”,“message”:“OK”,“server.address”:“ip-1-2-2-3.ec2.internal”,“event.action”:“ACCEPT”,“event.module”:“s3bucket”,“source.port”:“478”,“netw

嗨,我在流文件中有以下json:
{“destination.port”:“0000”,“network.packets”:“1”,“event.end”:“1563361839”,“source.address”:“1.2.2.1”,“message”:“OK”,“server.address”:“ip-1-2-2-3.ec2.internal”,“event.action”:“ACCEPT”,“event.module”:“s3bucket”,“source.port”:“478”,“network.protocol”:“6”,“cloud.account.id”:“123456”,“event.type”:“data”,“organization.id:“Fusion”,“destination.address:“1.2.2.2”,“network.bytes:“60”,“event.start:“1563361837”,“event.kind:“2”,“host.id:“eni-06f72”,“timestamp:“2019-07-17T11:16:39.792Z”}
带有event.end和event.start作为历元

我用的是nifi-1.9.2。
帮助我将历元转换为UTC格式的日期,并将其替换。我已尝试将
updateAttribute
处理器与
/event.start=${event.start:format(“yyyy-MM-dd HH:MM:ss.SSS”)}
,没有正确执行。我已经为处理器做了一些阅读,但没有。谢谢问题的根源是如何尝试从JSON中提取
事件.start
。表达式语言用于处理流文件的属性,而不是流文件的内容

如果此JSON在流文件的内容中,则使用
EvaluateJsonPath
,将
Destination
属性设置为
FlowFile属性
,并将名为
event.start
的新自定义属性设置为
$['event.start']

现在您将其作为属性,将其转移到
jolttransfermjson
,并将
Jolt-Transformation-DSL
设置为
Modify-Overwrite
,将
Jolt-Specification
设置为:

{
  "event.start": "${event.start:append('000'):format('yyyy-MM-dd HH:mm:ss.SSS')}"
}

附加的3个零是因为NiFi中的历元以毫秒为单位。

流文件属性和作为文件内容的json是不同的。UpdateAttributes仅与属性一起工作,并保持内容不变。@daggett是的,在我尝试时必须知道这一点。谢谢。