Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Adding sequence Number to filename

avatar
Explorer

Hi Nifi Experts,

I have a requirement to add a sequence number to file names in sequential order and reset the value to 1 on next run. 

 

Job is scheduled to run once every hour. I could see we can achieve incrementing the value using getStatevalue but not sure how can we reset the value. Could you please help me.

 

Thanks,

Kumar

 

1 REPLY 1

avatar
Master Collaborator

@kumar79 

Maybe you could reset the state via NiFi-REST-API at beginning of your flow?


Hava a look here: https://nifi.apache.org/docs/nifi-docs/rest-api/index.html

 

Could be:
POST "https://[ip:port]/nifi-api/processors/${pg-id}/state/clear-requests"

 

This is the request which NiFi itself uses when you go to the processor in the UI and choose the menu-option "view state" -> "clear state".