Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

NiFi: how to fulfill flow with massive of dates in attribute

avatar
Explorer

I want to make several invokeHTTP requests with dates from a date range in its URL.

So I have first date, for example 2020-05-01, and end date - 2020-05-31.

How automatically create massive: 2020-05-01, 2020-05-02, ..., 2020-05-31 and put it into URL.

Thanks in advance!

 

1 ACCEPTED SOLUTION

avatar
Master Collaborator

Hi @Maria_pl , generally speaking the approach is as follows:

1. Generate a dummy flow file that will trigger (GenerateFlowFile processor)

2. Next step is UpdateAttribute processor that sets the start date and end date as attributes in the flow file

3. ExecuteScript is next. This can be a python script, or whichever language you prefer, that will use the start and end attributes to list out all the dates in between.

4. If your script produces single file output of dates, you can then use SplitText processor to cut each row into its own flow file and from there each file will have its own unique date in your range.

 

Hope that makes sense. 

View solution in original post

1 REPLY 1

avatar
Master Collaborator

Hi @Maria_pl , generally speaking the approach is as follows:

1. Generate a dummy flow file that will trigger (GenerateFlowFile processor)

2. Next step is UpdateAttribute processor that sets the start date and end date as attributes in the flow file

3. ExecuteScript is next. This can be a python script, or whichever language you prefer, that will use the start and end attributes to list out all the dates in between.

4. If your script produces single file output of dates, you can then use SplitText processor to cut each row into its own flow file and from there each file will have its own unique date in your range.

 

Hope that makes sense.