Created 10-10-2019 09:58 AM
Hello @girish6,
NiFi Expression language does have a function that will increment a number, but it does not reset back to zero (unless you restart NiFi) and is incremented globally across call calls to that function.
So while this function will give each FlowFile a unique filename per NiFi node, there is no guarantee that they will be sequential or will start at 0 for new source zip file you extract. If this works for your use case the NiFi Expression language statement would look like this in the UpdateAttribute processor:
If you are just looking for filename uniqueness, a better solution may be to instead append the FlowFile's uniquely assigned UUID to the filename instead as follows:
Tips:
1. There is an expression language guide in the embedded help of your NiFi installation found by clicking on the global menu icon in upper right corner.
2. Within a NiFi processor property that support NiFi EL you can display a list of functions with details by typing "${" (signifies start of an EL statement) and then hold "Control" while clicking space bar. This also works if you are mid statement and type ":"then "control" + click spacebar.
Examples:
file-${ (then cntrl+spacebar)
${uuid: (then cntrl+spacebar)
Hope this helps,
Matt