I am working through a Nifi process group that generates a flowfile. I am trying to update the filename
attribute, but I notice a single quote gets added to the file too.
In there, you see #{snmp.hostname}-${now()}.json
This does work, but when I look at the output I see:
I don't see the quotes when I keep the flowfile filename as is. Here is my PutFile settings, pretty much the default:
Here is what is looks like when I don't update attribute, you see the file: 6fd0fcec-c838-4938-a600-5dbe99c4a370
(I do notice a leading space in that flowfile name too?).
Running NiFi 1.16.0 on a RHEL 8.5 machine.
Okay I found the problem. The problem was the date format in now()
contained spaces. It seems NiFi will inject a quote around the file name if there are spaces. Replacing ${now()}
with ${now():format("yyyy-MM-dd_HH:mm:ss.SSS'Z'", "America/Los_Angeles")}
gets rid of the spaces and leads to:
And that solves the problem.